diff options
| author | Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> | 2018-12-05 00:02:30 +0300 |
|---|---|---|
| committer | Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> | 2018-12-05 00:02:30 +0300 |
| commit | 848d1b65208213cb25f55e546faa08440d6af872 (patch) | |
| tree | 81a0ec8a858c6ef5e0ffb1306cbbac14c638a9f1 | |
| parent | reverse scrolling on commits implemented (diff) | |
| download | gitbatch-848d1b65208213cb25f55e546faa08440d6af872.tar.gz | |
queue converted to first in first out principle
| -rw-r--r-- | pkg/queue/queue.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/queue/queue.go b/pkg/queue/queue.go index b61d43b..871a380 100644 --- a/pkg/queue/queue.go +++ b/pkg/queue/queue.go @@ -88,7 +88,9 @@ func (jobQueue *JobQueue) AddJob(j *Job) error { return errors.New("Same job already is in the queue") } } - jobQueue.series = append(jobQueue.series, j) + jobQueue.series = append(jobQueue.series, nil) + copy(jobQueue.series[1:], jobQueue.series[0:]) + jobQueue.series[0] = j return nil } |
