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/hgTables/hgTables.c src/hg/hgTables/hgTables.c index 5dbf879..0b91123 100644 --- src/hg/hgTables/hgTables.c +++ src/hg/hgTables/hgTables.c @@ -1739,48 +1739,41 @@ curTrack = cTdb; else curTrack = tdb; } } void hgTables() /* hgTables - Get table data associated with tracks and intersect tracks. * Here we set up cart and some global variables, dispatch the command, * and put away the cart when it is done. */ { char *clade = NULL; -setUdcCacheDir(); - oldVars = hashNew(10); /* Sometimes we output HTML and sometimes plain text; let each outputter * take care of headers instead of using a fixed cart*Shell(). */ cart = cartAndCookieNoContent(hUserCookie(), excludeVars, oldVars); /* Set up global variables. */ allJoiner = joinerRead("all.joiner"); getDbGenomeClade(cart, &database, &genome, &clade, oldVars); freezeName = hFreezeFromDb(database); -int timeout = cartUsualInt(cart, "udcTimeout", 300); -if (udcCacheTimeout() < timeout) - udcSetCacheTimeout(timeout); -knetUdcInstall(); - char *backgroundStatus = cartUsualString(cart, "backgroundStatus", NULL); if (backgroundStatus) { getBackgroundStatus(backgroundStatus); exit(0); } char *backgroundExec = cgiUsualString("backgroundExec", NULL); if (sameOk(backgroundExec,"gsSendToDM")) { gsSendToDM(); exit(0); } /* Init track and group lists and figure out what page to put up. */