6696987406845625c252a13b690e0c4d7d9e59fa max Thu Mar 26 06:48:48 2015 -0700 This is a go at libifing the CGI startup code. For all CGIs, we need to call a few basic setup funtions, like UDC config and CGI apoptosis. (For most CGIs also bottleneck). Instead of adding it to all of our 30+ CGIs, I changed the cart*Shell functions. I think most CGIs call at least one of these functions. This commit removes the existing copy/pasted code from a few CGIs and replaces it with one call. Adding this to the cart-setup means that (like before), UDC is setup even for small JSON calls and a process is spawned to watch the CGI and kill it ("Apoptosis"). Any comments on whether this should be implemented differently are appreciated. I have not added bottleneck to this function right now as apparently we're calling bottleneck only from some of our CGIs. diff --git src/hg/hgc/bamClick.c src/hg/hgc/bamClick.c index 0da7544..2e7d740 100644 --- src/hg/hgc/bamClick.c +++ src/hg/hgc/bamClick.c @@ -165,34 +165,30 @@ return 0; } void doBamDetails(struct trackDb *tdb, char *item) /* Show details of an alignment from a BAM file. */ { if (item == NULL) errAbort("doBamDetails: NULL item name"); int start = cartInt(cart, "o"); if (!tdb || !trackDbSetting(tdb, "bamSkipPrintQualScore")) skipQualityScore = FALSE; else skipQualityScore = TRUE; // TODO: libify tdb settings table_pairEndsByName, stripPrefix and pairSearchRange -knetUdcInstall(); -if (udcCacheTimeout() < 300) - udcSetCacheTimeout(300); - if (sameString(item, "zoom in")) printf("Zoom in to a region with fewer items to enable 'detail page' links for individual items.<BR>"); char varName[1024]; safef(varName, sizeof(varName), "%s_pairEndsByName", tdb->track); boolean isPaired = cartUsualBoolean(cart, varName, (trackDbSetting(tdb, "pairEndsByName") != NULL)); char position[512]; safef(position, sizeof(position), "%s:%d-%d", seqName, winStart, winEnd); struct hash *pairHash = isPaired ? hashNew(0) : NULL; struct bamTrackData btd = {start, item, pairHash}; char *fileName = hReplaceGbdb(trackDbSetting(tdb, "bigDataUrl")); if (fileName == NULL) { if (isCustomTrack(tdb->table))