Skip to content

Commit 09fc3bf

Browse files
committed
Added CompileTools reset routine
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
1 parent 6e8aaad commit 09fc3bf

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/api/CompileTools.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export namespace CompileTools {
2525
updateProgress?: (message: string) => void
2626
}
2727

28+
export function reset(){
29+
ileQueue.clear();
30+
jobLogOrdinal = 0;
31+
}
32+
2833
/**
2934
* Execute a command
3035
*/

src/api/IBMi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,8 @@ export default class IBMi {
11701170
}
11711171

11721172
private async dispose() {
1173+
CompileTools.reset();
1174+
11731175
//Clear connected resources
11741176
if (this.sqlJob) {
11751177
delete this.sqlJob;

src/api/queue.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
export class SimpleQueue {
2-
private static _instance: SimpleQueue | null = null;
3-
4-
static get instance() {
5-
if (!this._instance) {
6-
this._instance = new SimpleQueue();
7-
}
8-
return this._instance;
9-
}
10-
112
private delay = 0; // milliseconds
12-
private queue: (() => Promise<void>)[] = [];
3+
private readonly queue: (() => Promise<void>)[] = [];
134
private queueRunning = false;
145

156
setDelay(delay: number) {
167
this.delay = delay;
178
}
189

10+
clear(){
11+
this.queue.splice(0, this.queue.length);
12+
}
13+
1914
next<T>(run: () => Promise<T>, cancelCheck?: () => boolean): Promise<T> {
2015
return new Promise<T>((resolve, reject) => {
2116
this.queue.push(async () => {

0 commit comments

Comments
 (0)