Extractor.watch()
This commit is contained in:
@ -54,11 +54,22 @@ export class Extractor {
|
||||
start() {
|
||||
return this._startTasks(0);
|
||||
}
|
||||
stop() {
|
||||
stop(id?: number) {
|
||||
if (id !== undefined) {
|
||||
id = this._checkTaskId(id);
|
||||
if (id < 0) return;
|
||||
this._tasks[id].stop();
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this._tasks.length; i++) {
|
||||
this._tasks[i].stop();
|
||||
}
|
||||
}
|
||||
watch(id: number) {
|
||||
id = this._checkTaskId(id);
|
||||
if (id < 0) return;
|
||||
this._tasks[id].watch();
|
||||
}
|
||||
/**
|
||||
* restart from specified task, but don't restart the previous tasks.
|
||||
* @param {number} from where to restart the tasks, begins with 0
|
||||
@ -138,7 +149,7 @@ ${exResults.toString(50) || "- Empty -"}
|
||||
saveFile(exResults.toString(), "text/csv");
|
||||
}
|
||||
}
|
||||
_checkTaskId(id: number, defaultId: number) {
|
||||
_checkTaskId(id: number, defaultId?: number) {
|
||||
if (!this._tasks.length) {
|
||||
logger.info("No task found.");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user