diff options
Diffstat (limited to 'worker')
-rw-r--r-- | worker/worker.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/worker/worker.go b/worker/worker.go index f56716f..06fac36 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -91,10 +91,12 @@ func (w *Worker) StartWorker(model db.EntryModel) { } func (w *Worker) GetJobs() []Job { - jobs := []Job{} + jobs := make([]Job, len(w.jobs)) + count := 0 for k, v := range w.jobs { - jobs = append(jobs, Job{Id: k, Status: v}) + jobs[count] = Job{Id: k, Status: v} + count++ } return jobs |