1db14ecb3013ea661bb93435c60618550a4e8e3f max Mon May 12 11:50:05 2025 -0700 making sleep depend on hg.conf statement suggested by Jonathan, no redmine ticket yet diff --git src/hg/lib/botDelay.c src/hg/lib/botDelay.c index 4204f8ce51b..d9bea151b67 100644 --- src/hg/lib/botDelay.c +++ src/hg/lib/botDelay.c @@ -249,30 +249,31 @@ printf("

Status %d: %s

\n", err429, err429Msg); time_t now = time(NULL); printf("There is an exceedingly high volume of traffic coming from your " "site (IP address %s) as of %s (California time). It looks like " "a web robot is launching queries quickly, and not even waiting for " "the results of one query to finish before launching another query. " "We cannot service requests from your IP address under these " "conditions. (code %d) " "To use the genome browser functionality from a Unix command line, " "please read our FAQ on this topic. " "For further help on how to access our data from a command line, " "or if " "you think this delay is being imposed unfairly, please contact genome-www@soe.ucsc.edu." ,hogHost, asctime(localtime(&now)), botDelayMillis); puts(""); + if (cfgOptionBooleanDefault("sleepOn429", TRUE)) sleep(10); } cgiExitTime(cgiExitName, enteredMainTime); exit(0); } /* static void hogExit() */ boolean earlyBotCheck(long enteredMainTime, char *cgiName, double delayFrac, int warnMs, int exitMs, char *exitType) /* replaces the former botDelayCgi now in use before the CGI has started any * output or setup the cart of done any MySQL operations. The boolean * return is used later in the CGI after it has done all its setups and * started output so it can issue the warning. Pass in delayFrac 0.0 * to use the default 1.0, pass in 0 for warnMs and exitMs to use defaults, * and exitType is either 'html' or 'json' to do that type of exit output in * the case of hogExit(); */