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