83f8234095a0b5e6edb8aaaeabb8e78443830ea3 hiram Thu Apr 23 13:48:43 2026 -0700 turn off the email notification from here, let the otto cron job do the email refs #31811 diff --git src/hg/hubApi/liftOver.c src/hg/hubApi/liftOver.c index 2e11ae808da..a8866ced49d 100644 --- src/hg/hubApi/liftOver.c +++ src/hg/hubApi/liftOver.c @@ -1,28 +1,30 @@ /* liftOver functions */ #include "dataApi.h" #include "hgFind.h" #include "cartTrackDb.h" #include "cartJson.h" #include "genark.h" #include "asmAlias.h" #include "assemblyList.h" #include "liftOver.h" #include "liftOverChain.h" #include "net.h" +/* do not need the mailViaPipe function here #include "mailViaPipe.h" +*/ /**** SHOULD BE IN LIBRARY - code from hgConvert.c ******/ static long chainTotalBlockSize(struct chain *chain) /* Return sum of sizes of all blocks in chain */ { struct cBlock *block; long total = 0; for (block = chain->blockList; block != NULL; block = block->next) total += block->tEnd - block->tStart; return total; } /**** SHOULD BE IN LIBRARY - code from hgConvert.c ******/ static void chainListOut(char *fromDb, char* toDb, int origSize, char *fromPos, struct chain *chainList) /* given the list of chains, output the list in JSON */ @@ -312,32 +314,35 @@ char *toAddr = cfgOption("chainFileRequestEmail"); char *fromAddr = cfgOption("apiFromEmail"); if (isNotEmpty(toAddr) && isNotEmpty(fromAddr)) { char nowTime[256]; time_t seconds = clock1(); struct tm *timeNow = localtime(&seconds); strftime(nowTime, sizeof nowTime, "%Y-%m-%d %H:%M:%S", timeNow); struct dyString *msg = newDyString(0); /* may need to encode these inputs to make them safe */ dyStringPrintf(msg, "%s\nLift over request\nfrom: %s\nto: %s\nemail '%s'\ncomment: '%s'", nowTime, fromGenome, toGenome, email, comment); /* Even if the mailViaPipe returned a relevant return code, and I'm not * sure it would, there isn't much we can do about it from here. - */ + * Do *not* need to send email from here. The cron job watch script + * in the otto user will see the table updated and take care of + * the email notifications (void) mailViaPipe(toAddr, "liftOver request", msg->string, fromAddr); + */ /* some kind of response here back to the request page */ struct jsonWrite *jw = apiStartOutput(); jsonWriteString(jw, "msg", dyStringCannibalize(&msg)); apiFinishOutput(0,NULL,jw); char *ottoTable = cfgOption("ottoTable"); /* probably ottoRequest */ if (isNotEmpty(ottoTable)) { struct sqlConnection *conn = hConnectCentral(); if (sqlTableExists(conn, ottoTable)) { struct dyString *update = newDyString(0); sqlDyStringPrintf(update, "INSERT INTO %s (requestType, fromDb, toDb, email, comment, requestTime, doneStatus, workflowId) VALUES ( 'liftOver', '%s','%s','%s','%s',now(), 0, 0)", ottoTable, fromGenome, toGenome, email, comment);