91d7992f30d5756c352c83ff563405551dc64e1c braney Tue Aug 16 16:37:01 2011 -0700 various changes concerning the soft-reset button for #4815 diff --git src/hg/lib/hubConnect.c src/hg/lib/hubConnect.c index c98fc84..ddc82ee 100644 --- src/hg/lib/hubConnect.c +++ src/hg/lib/hubConnect.c @@ -538,15 +538,36 @@ return id; } void hubDisconnect(struct cart *cart, char *url) /* drop the information about this url from the hubStatus table, and * the cart variable the references this hub */ { /* clear the hubStatus table */ unsigned id = hubClearStatus(url); /* remove the cart variable */ char buffer[1024]; safef(buffer, sizeof buffer, "hgHubConnect.hub.%d", id); cartRemove(cart, buffer); } + +void hubSetErrorMessage(char *errorMessage, unsigned id) +/* set the error message in the hubStatus table */ +{ +struct sqlConnection *conn = hConnectCentral(); +char query[256]; +if (errorMessage != NULL) + { + safef(query, sizeof(query), + "update %s set errorMessage=\"%s\", lastNotOkTime=now() where id=%d", + hubStatusTableName, errorMessage, id); + } +else + { + safef(query, sizeof(query), + "update %s set errorMessage=\"\", lastOkTime=now() where id=%d", + hubStatusTableName, id); + } +sqlUpdate(conn, query); +hDisconnectCentral(&conn); +}