Merge pull request #74 from pierotofy/longrunfix

Fix premature deletion of long run tasks
pull/79/head
Piero Toffanin 2019-02-13 16:00:14 -05:00 zatwierdzone przez GitHub
commit 83bfe4b776
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -71,10 +71,13 @@ class TaskManager{
for (let uuid in this.tasks){
let task = this.tasks[uuid];
let dateFinished = task.dateCreated;
if (task.processingTime > 0) dateFinished += task.processingTime;
if ([statusCodes.FAILED,
statusCodes.COMPLETED,
statusCodes.CANCELED].indexOf(task.status.code) !== -1 &&
now - task.dateCreated > CLEANUP_TASKS_IF_OLDER_THAN){
now - dateFinished > CLEANUP_TASKS_IF_OLDER_THAN){
list.push(task.uuid);
}
}