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/hgCustom/hgCustom.c src/hg/hgCustom/hgCustom.c
index f56033c..8b8e8a2 100644
--- src/hg/hgCustom/hgCustom.c
+++ src/hg/hgCustom/hgCustom.c
@@ -1084,34 +1084,30 @@
char *err = NULL, *warn = NULL;
char *selectedTable = NULL;
struct customTrack *ct = NULL;
boolean ctUpdated = FALSE;
char *initialDb = NULL;
long thisTime = clock1000();
cart = theCart;
measureTiming = isNotEmpty(cartOptionalString(cart, "measureTiming"));
initialDb = cloneString(cartString(cart, "db"));
getDbAndGenome(cart, &database, &organism, oldVars);
customFactoryEnableExtraChecking(TRUE);
-knetUdcInstall();
-if (udcCacheTimeout() < 300)
- udcSetCacheTimeout(300);
-
if (sameString(initialDb, "0"))
{
/* when an organism is selected from the custom track management page,
* set the database to be the default only if it has custom tracks.
* Otherwise, pick an assembly for that organism that does have custom tracks. */
struct dbDb *dbDb, *dbDbs = getCustomTrackDatabases();
char *dbWithCts = NULL;
for (dbDb = dbDbs; dbDb != NULL; dbDb = dbDb->next)
{
if (sameString(database, dbDb->name))
break;
if (sameString(organism, dbDb->organism))
{
if (!dbWithCts)
dbWithCts = cloneString(dbDb->name);