mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
First pass at using the work queue.
This commit is contained in:
@@ -19,7 +19,9 @@ export default class GitWorkQueue {
|
||||
|
||||
this.queue.push(this.wrapFunction(fn, resolve, reject))
|
||||
|
||||
this.startNext()
|
||||
if (this.shouldStartNext()) {
|
||||
this.startNext()
|
||||
}
|
||||
|
||||
return wrapperPromise
|
||||
}
|
||||
@@ -41,7 +43,9 @@ export default class GitWorkQueue {
|
||||
taskDidComplete () {
|
||||
this.working = false
|
||||
|
||||
this.startNext()
|
||||
if (this.shouldStartNext()) {
|
||||
this.startNext()
|
||||
}
|
||||
}
|
||||
|
||||
shouldStartNext () {
|
||||
@@ -49,8 +53,6 @@ export default class GitWorkQueue {
|
||||
}
|
||||
|
||||
startNext () {
|
||||
if (!this.shouldStartNext()) return
|
||||
|
||||
this.working = true
|
||||
|
||||
const fn = this.queue.shift()
|
||||
|
||||
Reference in New Issue
Block a user