7d7e2185f8a8ef113972a038534987d49b443d32
hiram
  Fri Aug 16 13:10:00 2019 -0700
now adding penalty in relation to number of custom tracks added refs #23217

diff --git src/hg/hgTracks/renderMain.c src/hg/hgTracks/renderMain.c
index b2cdf7b..8aa00ef 100644
--- src/hg/hgTracks/renderMain.c
+++ src/hg/hgTracks/renderMain.c
@@ -23,30 +23,32 @@
 /* Print out usage and exit - just temporary. */
 {
 errAbort(
 "hgRenderTracks - execute enough of browser to render a list of tracks\n"
 "usage:\n"
 "      hgTrackRender track.ra cart.ra output.ps\n"
 "where track.ra is a trackDb.ra entry flattened out to include stuff inherited from parent\n"
 "and cart.ra is a file with the cart settings.  Both .ra files should just have a single stanza\n"
 );
 }
 
 static struct optionSpec options[] = {
    {NULL, 0},
 };
 
+long enteredMainTime = 0;
+
 struct trackDb *hTrackDbForTrackAndAncestors(char *db, char *track);
 /* Load trackDb object for a track. If need be grab its ancestors too. 
  * This does not load children. hTrackDbForTrack will handle children, and
  * is actually faster if being called on lots of tracks.  This function
  * though is faster on one or two tracks. */
 
 static void hashIntoHash(struct hash *newStuff, struct hash *hash)
 /* Add newStuff into hash. */
 {
 struct hashCookie cookie = hashFirst(newStuff);
 struct hashEl *hel;
 while ((hel = hashNext(&cookie)) != NULL)
     hashAdd(hash, hel->name, hel->val);
 }
 
@@ -102,31 +104,31 @@
 /* Initialize global image box. */
 int sideSliceWidth  = 0;   // Just being explicit
 if (withLeftLabels)
     sideSliceWidth   = (insideX - gfxBorder*3) + 2;
 theImgBox = imgBoxStart(database,chromName,winStart,winEnd,(!revCmplDisp),sideSliceWidth,tl.picWidth);
 makeActiveImage(trackList, NULL);
 verboseTime(2,"After makeActiveImage");
 }
 
 boolean issueBotWarning;
 
 int main(int argc, char *argv[])
 {
 if(argc == 1)
     {
-    long enteredMainTime = clock1000();
+    enteredMainTime = clock1000();
     issueBotWarning = earlyBotCheck(enteredMainTime, "hgRenderTracks", delayFraction, warnMs, exitMs);
     // CGI call
 
     // htmlPushEarlyHandlers(); XXXX do I need to do this?
 
     hPrintDisable();
     oldVars = hashNew(10);
     struct cart *cart = cartForSession(hUserCookie(), excludeVars, oldVars);
 
     // setup approriate CGI variables which tell hgTracks code what to do.
     cartSetBoolean(cart, "hgt.trackImgOnly", TRUE);
     if(cartVarExists(cart, "jsonp"))
         {
         // experimental code to support remote rendering via a jsonp callback
         // e.g.: /cgi-bin/hgRenderTracks?track=bamMMS9MbutiPygmy&track=...&jsonp=remoteTrackCallback&postion=...&pix=800