b9effab31037a381ef7f6986aed55831c010a6ce galt Fri Aug 15 15:52:26 2014 -0700 do not copy in stderr background output if the file was already successfully uploaded diff --git src/hg/hgTables/genomeSpace.c src/hg/hgTables/genomeSpace.c index 73f0931..2031695 100644 --- src/hg/hgTables/genomeSpace.c +++ src/hg/hgTables/genomeSpace.c @@ -471,42 +471,45 @@ return; } int start; for (start=end; start >= 0 && ! (startsWith("<html>", lines[start]) || startsWith("<HTML>", lines[start])) ; --start) /* do nothing */ ; if (start < 0) { htmlOpen("Background Status"); errAbort("No html start tag found"); htmlClose(); return; } puts("Content-Type: text/html\n"); int line; boolean autoRefreshFound = FALSE; +boolean successfullyUploaded = FALSE; for (line=start; line <= end; line++) { puts(lines[line]); if (startsWith("setTimeout(\"location = location;", lines[line])) autoRefreshFound = TRUE; + if (startsWith("Output has been successfully uploaded", lines[line])) + successfullyUploaded = TRUE; } // if it looks like the background is no longer running, // include the .err stdout output for more informative problem message char urlErr[512]; char *textErr = NULL; safef(urlErr, sizeof urlErr, "%s.err", url); -if (!autoRefreshFound && (fileSize(urlErr) > 0)) +if (!autoRefreshFound && !successfullyUploaded && (fileSize(urlErr) > 0)) { readInGulp(urlErr, &textErr, NULL); printf("%s", textErr); } } #include "trashDir.h" // TODO move this to a generic re-usable location void startBackgroundWork(char *exec, char **pWorkUrl) /* deal with forking off child for background work * and setting up the trash file for communicating * from the child to the browser */ { char *workUrl = NULL; char hgsid[64];