79ab7bed49d3d2a550d372fb58ab4bb283a6d31e braney Thu Jan 30 00:08:47 2020 -0800 append trackDb names to the end of the db for trackDb cache directory to support comma-separated lists of trackDb tables diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 3ea0cb4..355c50b 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -4131,53 +4131,60 @@ 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; boolean doCache = trackDbCacheOn(); +char *tdbPathString = hTrackDbPath(); if (doCache) { - char *table = hTrackDbPath(); + struct slName *tableList = hTrackDbList(); struct sqlConnection *conn = hAllocConn(db); - time_t tableTime = sqlTableUpdateTime(conn, table); + time_t newestTime = 0; + for(; tableList; tableList = tableList->next) + { + time_t tableTime = sqlTableUpdateTime(conn, tableList->name); + newestTime = tableTime > newestTime ? tableTime : newestTime; + } + hFreeConn(&conn); - struct trackDb *cacheTdb = trackDbCache(db, tableTime); + struct trackDb *cacheTdb = trackDbCache(db, tdbPathString, newestTime); 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()); + trackDbCloneTdbListToSharedMem(db, tdbPathString, 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.