mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Reduce flag checking.
This commit is contained in:
@@ -306,7 +306,7 @@ function onJobStart(error, res, body) {
|
||||
tunnel = this.tunnel;
|
||||
|
||||
this.starting = false;
|
||||
if (this.stopping || tunnel.starting || tunnel.stopping) {
|
||||
if (this.stopping || tunnel.starting) {
|
||||
return;
|
||||
}
|
||||
if (error || !id || statusCode != 200) {
|
||||
@@ -354,7 +354,7 @@ function onJobStatus(error, res, body) {
|
||||
url = data.url;
|
||||
|
||||
this.checking = false;
|
||||
if (this.starting || this.stopping || tunnel.starting || tunnel.stopping) {
|
||||
if (!this.running || this.stopping) {
|
||||
return;
|
||||
}
|
||||
this.emit('status', jobStatus);
|
||||
@@ -514,6 +514,7 @@ Job.prototype.stop = function(callback) {
|
||||
}
|
||||
this.stopping = true;
|
||||
if (this.statusId) {
|
||||
this.checking = false;
|
||||
this.statusId = clearTimeout(this.statusId);
|
||||
}
|
||||
if (this.id == null || !this.running) {
|
||||
|
||||
Reference in New Issue
Block a user