Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 1f7c5eb

Browse files
committed
Allow force updating job monitor
1 parent d49a692 commit 1f7c5eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/JobMonitor.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default class JobMonitor {
6262
this._filterTags = [];
6363
this._purge = false;
6464
this._skipMaxUpdate = false;
65+
this._waiting = 0;
6566
}
6667

6768
/**
@@ -98,15 +99,15 @@ export default class JobMonitor {
9899
* @throws {ApiError}
99100
* @todo refactor
100101
*/
101-
update () {
102-
if (this.waiting || this._lastUpdate === this._getTimestamp()) {
102+
update (force = false) {
103+
if (!force && (this.waiting || this._lastUpdate === this._getTimestamp())) {
103104
return new Promise(resolve => {
104105
resolve(0); // Still waiting for the other promise to resolve or we're sure there is no new data
105106
});
106107
}
107108

108109
// Counter so we don't have to worry about racing
109-
this._waiting = 1;
110+
this._waiting += 1;
110111

111112
if (this._purge) {
112113
this._data = [];

0 commit comments

Comments
 (0)