diff options
author | Florian Klink <flokli@flokli.de> | 2019-11-25T17·12+0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2019-11-25T17·12+0100 |
commit | b65f56c6e2469ef23ea8bdd8534048fa382c9670 (patch) | |
tree | 3db7f297153e6a1f28919d0a751559020a4aeca6 /submitqueue | |
parent | 3898495d56f1a2f2e92bf5a9a1e88cb5a2689498 (diff) |
frontend: return state atomically, remove GetSubmitQueue
Diffstat (limited to 'submitqueue')
-rw-r--r-- | submitqueue/runner.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/submitqueue/runner.go b/submitqueue/runner.go index 6c8d37a304ec..456e49cd12b6 100644 --- a/submitqueue/runner.go +++ b/submitqueue/runner.go @@ -20,17 +20,11 @@ func NewRunner(sq *SubmitQueue) *Runner { } } -// For the frontend to consume the data -// TODO: extend to return all the submitQueue results -func (r *Runner) GetResults() (*time.Time, []*Result) { +// GetState returns a copy of all the state for the frontend +func (r *Runner) GetState() (SubmitQueue, *time.Time, []*Result) { r.mut.Lock() defer r.mut.Unlock() - return r.currentlyRunning, r.results -} - -// GetSubmitQueue returns the submit queue object, to be consumed by the frontend -func (r *Runner) GetSubmitQueue() (*SubmitQueue) { - return r.submitQueue + return *r.submitQueue, r.currentlyRunning, r.results } // Trigger starts a new batch job |