c7f117d5fc2aee9e65222776a7dae1bdd8ae7c6f
max
  Tue Oct 31 08:46:40 2023 -0700
making FAQlink page for china, refs #32535

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 5b5b732..a57603a 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -776,31 +776,31 @@
 /* Put back connection for reuse. */
 {
 if (*pConn != NULL)  // don't use hdbCc if never allocated
     sqlConnCacheDealloc(hdbCc, pConn);
 }
 
 static void hCentralMkCache()
 /* create the central database cache, trying to connect to the
  * database and failing over if needed */
 {
 char *centralProfile = "central";
 centralDb = cfgOption2(centralProfile, "db");
 centralCc = sqlConnCacheNewProfile(centralProfile);
 sqlSetParanoid(TRUE);
 struct sqlConnection *conn = sqlConnCacheMayAlloc(centralCc, centralDb);
-if ((conn == NULL) || !cartTablesOk(conn))
+if ((conn == NULL) || (cgiIsOnWeb() && !cartTablesOk(conn)))
     {
     fprintf(stderr, "hConnectCentral failed over to backupcentral "
             "pid=%ld\n", (long)getpid());
     sqlConnCacheDealloc(centralCc, &conn);
     sqlConnCacheFree(&centralCc);
     centralProfile = "backupcentral";
     centralDb = cfgOption2(centralProfile, "db");
     centralCc = sqlConnCacheNewProfile(centralProfile);
     conn = sqlConnCacheAlloc(centralCc, centralDb);
     if (!cartTablesOk(conn))
         errAbort("Cannot access cart tables in central (nor backupcentral) "
                  "database.  Please check central and backupcentral "
                  "settings in the hg.conf file and the databases they "
                  "specify.");
     }