1c3d6739756883f6ac712e75eac7915a715545ef
galt
  Sun Nov 4 15:03:42 2018 -0800
Checking in new version 38 of refreshNamedSessionCustomTracks. I added the function setMinIndexLengthForTrashCleaner() to src/hg/lib/hdb.c since the trash cleaner will fail otherwise whenever you have a saved session with a custom track that is on a hub that is currently unavailable. Rather than risk losing the table in custom trash database, it needs to avoid this error and continue touching and running.

diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h
index 6e0c67a..e703eb3 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -871,30 +871,41 @@
  * ra sub-hash. */
 
 char *addCommasToPos(char *db, char *position);
 /* add commas to the numbers in a position
  * returns pointer to static */
 
 boolean parsePosition(char *position, char **retChrom, uint *retStart, uint *retEnd);
 /* If position is word:number-number (possibly with commas & whitespace),
  * set retChrom, retStart (subtracting 1) and retEnd, and return TRUE.
  * Otherwise return FALSE and leave rets unchanged. */
 
 struct grp* hLoadGrps(char *db);
 /* load the grp tables using the list configured in hg.conf, returning a list
  * sorted by priority. */
 
+void setMinIndexLengthForTrashCleaner();
+/* set the minimum index size so trash cleaner will not die
+ * on custom tracks on hubs that are not currently loading.
+ * However, they might be re-established in the future,
+ * and we want to allow it to proceed without failure
+ * in order to touch the trash database table access times,
+ * preserving them from the trash cleaner.
+ * Only the trash cleaner should call this:
+ *  src/hg/utils/refreshNamedCustomTracks/refreshNamedCustomTracks.c 
+ */
+
 int hGetMinIndexLength(char *db);
 /* get the minimum index size for the given database that won't smoosh
  * together chromNames such that any group of smooshed entries has a
  * cumulative size greater than the the largest chromosome.  Allow one
  * exception cuz we're nice
  */
 
 int chrStrippedCmp(char *chrA, char *chrB);
 /*	compare chrom names after stripping chr, Scaffold_ or ps_ prefix */
 
 int chrNameCmp(char *str1, char *str2);
 /* Compare chromosome names by number, then suffix.  str1 and str2 must
  * match the regex "chr([0-9]+|[A-Za-z0-9]+)(_[A-Za-z0-9_]+)?". */
 
 int chrSlNameCmp(const void *el1, const void *el2);