85e8f7400bfa53d4189f56729b3a12718f734125
max
  Mon Oct 13 14:20:01 2025 -0700
closing all hgcentral mysql connections before botDelay sleeping, refs #36498

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index ea5fc3bc252..170c3c868a3 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -825,30 +825,36 @@
  * not specific to a particular genome lives.  Free this up
  * with hDisconnectCentral(). */
 {
 if (centralCc == NULL)
     hCentralMkCache();
 return sqlConnCacheAlloc(centralCc, centralDb);
 }
 
 void hDisconnectCentral(struct sqlConnection **pConn)
 /* Put back connection for reuse. */
 {
 if (*pConn != NULL)
     sqlConnCacheDealloc(centralCc, pConn);
 }
 
+void hFreeAllCentral() 
+/* disconnect and free all connections in the hgCentral connection cache */
+{
+    sqlConnCacheFree(&centralCc);
+}
+
 static void hCartMkCache()
 /* Create the cart connection cache.  Defaults to the central connection
  * unless cart.db or cart.host are configured. */
 {
 if ((cfgOption("cart.db") != NULL) || (cfgOption("cart.host") != NULL)
     || (cfgOption("cart.user") != NULL) || (cfgOption("cart.password") != NULL))
     {
     /* use explict cart options */
     cartDb = cfgOption("cart.db");
     if ((cartDb == NULL) || (cfgOption("cart.host") == NULL)
         || (cfgOption("cart.user") == NULL) || (cfgOption("cart.password") == NULL))
         errAbort("Must specify either all or none of the cart options in the hg.conf file.");
     cartCc = sqlConnCacheNewProfile("cart");
     /* make sure this database goes through that profile */
     sqlProfileAddDb("cart", cartDb);