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/hgVai/hgVai.c src/hg/hgVai/hgVai.c
index 66f910b..e84ffc6 100644
--- src/hg/hgVai/hgVai.c
+++ src/hg/hgVai/hgVai.c
@@ -2278,35 +2278,30 @@
cgiSpoof(&argc, argv);
oldVars = hashNew(10);
setUdcCacheDir();
boolean startQuery = (cgiUsualString("hgva_startQuery", NULL) != NULL);
if (startQuery)
cart = cartAndCookieNoContent(hUserCookie(), excludeVars, oldVars);
else
cart = cartAndCookie(hUserCookie(), excludeVars, oldVars);
/* Set up global variables. */
getDbAndGenome(cart, &database, &genome, oldVars);
regionType = cartUsualString(cart, hgvaRegionType, hgvaRegionTypeGenome);
if (isEmpty(cartOptionalString(cart, hgvaRange)))
cartSetString(cart, hgvaRange, hDefaultPos(database));
-int timeout = cartUsualInt(cart, "udcTimeout", 300);
-if (udcCacheTimeout() < timeout)
- udcSetCacheTimeout(timeout);
-knetUdcInstall();
-
cartTrackDbInit(cart, &fullTrackList, &fullGroupList, TRUE);
if (lookupPosition(cart, hgvaRange))
{
if (startQuery)
doQuery();
else
doUi();
}
else
{
// Revert to lastPosition if we have multiple matches or warnings,
// especially in case user manually edits browser location as in #13009:
char *position = cartUsualString(cart, "lastPosition", hDefaultPos(database));
cartSetString(cart, hgvaRange, position);
if (webGotWarnings())