a47f57d008f2db28a7b140ece87cbcfb8e8a5c0c hiram Thu Sep 12 14:18:19 2019 -0700 expand earlyBotCheck to manage two types of outputs, recognize defaults, and adding hgGateway to the game refs #23217 diff --git src/hg/hgCustom/hgCustom.c src/hg/hgCustom/hgCustom.c index 2a677a8..5c40a64 100644 --- src/hg/hgCustom/hgCustom.c +++ src/hg/hgCustom/hgCustom.c @@ -16,32 +16,30 @@ #include "customTrack.h" #include "customFactory.h" #include "portable.h" #include "errCatch.h" #include "knetUdc.h" #include "udc.h" #include "net.h" #include "jsHelper.h" #include #include "trackHub.h" #include "botDelay.h" static long loadTime = 0; static boolean issueBotWarning = FALSE; #define delayFraction 0.25 /* same as hgTracks */ -#define warnMs 10000 /* warning at 10 to 20 second delay */ -#define exitMs 20000 /* error 429 Too Many Requests after 20+ second delay */ void usage() /* Explain usage and exit. */ { errAbort( "hgCustom - Custom track management CGI\n" "usage:\n" " hgCustom \n" ); } /* DON'T EDIT THIS -- use CGI param "&measureTiming=." */ static boolean measureTiming = FALSE; #define TEXT_ENTRY_ROWS 7 @@ -1386,23 +1384,23 @@ } if (ctList || cartVarExists(cart, hgCtDoDelete)) doManageCustom(warnMsg); else doAddCustom(warnMsg); } cartRemovePrefix(cart, hgCt); cartRemove(cart, CT_CUSTOM_TEXT_VAR); } int main(int argc, char *argv[]) /* Process command line. */ { long enteredMainTime = clock1000(); -issueBotWarning = earlyBotCheck(enteredMainTime, "hgCustom", delayFraction, warnMs, exitMs); +issueBotWarning = earlyBotCheck(enteredMainTime, "hgCustom", delayFraction, 0, 0, "html"); htmlPushEarlyHandlers(); oldVars = hashNew(10); cgiSpoof(&argc, argv); cartEmptyShell(doMiddle, hUserCookie(), excludeVars, oldVars); cgiExitTime("hgCustom", enteredMainTime); return 0; }