X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f5162efc3578d0420e869e3fcbda46454a855909..0783caa882a7c45c24b5a054957a1568ad55ed99:/lib/lsf/lsfqueue.go diff --git a/lib/lsf/lsfqueue.go b/lib/lsf/lsfqueue.go index 3c4fc4cb8c..60f01640a0 100644 --- a/lib/lsf/lsfqueue.go +++ b/lib/lsf/lsfqueue.go @@ -23,12 +23,12 @@ type lsfqueue struct { latest map[string]bjobsEntry } -// JobID waits for the next queue update (so even a job that was only +// Lookup waits for the next queue update (so even a job that was only // submitted a nanosecond ago will show up) and then returns the LSF -// job ID corresponding to the given container UUID. -func (q *lsfqueue) JobID(uuid string) (int, bool) { +// queue information corresponding to the given container UUID. +func (q *lsfqueue) Lookup(uuid string) (bjobsEntry, bool) { ent, ok := q.getNext()[uuid] - return ent.id, ok + return ent, ok } // All waits for the next queue update, then returns the names of all @@ -58,7 +58,7 @@ func (q *lsfqueue) getNext() map[string]bjobsEntry { func (q *lsfqueue) init() { q.updated = sync.NewCond(&q.mutex) q.nextReady = make(chan (<-chan struct{})) - ticker := time.NewTicker(time.Second) + ticker := time.NewTicker(q.period) go func() { for range ticker.C { // Send a new "next update ready" channel to @@ -94,7 +94,7 @@ func (q *lsfqueue) init() { } next := make(map[string]bjobsEntry, len(ents)) for _, ent := range ents { - next[ent.name] = ent + next[ent.Name] = ent } // Replace q.latest and notify all the // goroutines that the "next update" they