612baf5a4599ab93d0f430c538e9fb16bc3c8d3d braney Mon Jun 24 13:51:05 2019 -0700 move trackDbCache stuff to its own file. Remove dependencies on /dev/shm being the cache location. diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 50c5099..3ea0cb4 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -4130,57 +4130,54 @@ struct trackDb *hTrackDb(char *db) /* Load tracks associated with current db. * Supertracks are loaded as a trackDb, but are not in the returned list, * but are accessible via the parent pointers of the member tracks. Also, * the supertrack trackDb subtrack fields are not set here (would be * incompatible with the returned list) * Returns list sorted by priority * NOTE: this result is cached, do not free it ! */ { if (trackHubDatabase(db)) return NULL; struct trackDb *tdbList = NULL; -char *trackDbCacheDir = cfgOption("cacheTrackDbDir"); -boolean doCache = FALSE; -if (trackDbCacheDir != NULL) - doCache = TRUE; +boolean doCache = trackDbCacheOn(); if (doCache) { char *table = hTrackDbPath(); struct sqlConnection *conn = hAllocConn(db); time_t tableTime = sqlTableUpdateTime(conn, table); hFreeConn(&conn); - struct trackDb *cacheTdb = trackDbCache(db, tableTime, trackDbCacheDir); + struct trackDb *cacheTdb = trackDbCache(db, tableTime); if (cacheTdb != NULL) return cacheTdb; memCheckPoint(); // we want to know how much memory is used to build the tdbList } tdbList = loadTrackDb(db, NULL); tdbList = trackDbLinkUpGenerations(tdbList); tdbList = trackDbPolishAfterLinkup(tdbList, db); if (doCache) - trackDbCloneTdbListToSharedMem(db, tdbList, memCheckPoint(), trackDbCacheDir); + trackDbCloneTdbListToSharedMem(db, tdbList, memCheckPoint()); return tdbList; } static struct trackDb *loadAndLookupTrackDb(struct sqlConnection *conn, char *where) /* Load trackDb object(s). Nothing done for composite tracks here. */ { return loadTrackDb(sqlGetDatabase(conn), where); } static struct trackDb *loadTrackDbForTrack(struct sqlConnection *conn, char *track) /* Load trackDb object for a track. this is common code for two external * functions. Handle composite tracks and subtrack inheritance here.