-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1920 - remove timeout logic for import and augment timeout #1928
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,12 @@ | |
* Shanoir NG - Import, manage and share neuroimaging data | ||
* Copyright (C) 2009-2019 Inria - https://www.inria.fr/ | ||
* Contact us on https://project.inria.fr/shanoir/ | ||
* | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
@@ -23,7 +23,7 @@ import { SuperTimeout } from 'src/app/utils/super-timeout'; | |
|
||
@Injectable() | ||
export class NotificationsService { | ||
|
||
public nbNew: number = 0; | ||
public nbNewError: number = 0; | ||
private tasks: Task[] = []; | ||
|
@@ -42,7 +42,7 @@ export class NotificationsService { | |
readonly readInterval: number = 1000; | ||
readonly persistenceTime: number = 1800000; | ||
private freshTimeouts: SuperTimeout[] = []; | ||
private readonly TIMEOUT: number = 30000; | ||
private readonly TIMEOUT: number = 300000; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had problem with the timeout, sometimes it takes more than 30sc to be updated. |
||
|
||
|
||
constructor(private taskService: TaskService, private keycloakService: KeycloakService) { | ||
|
@@ -93,13 +93,13 @@ export class NotificationsService { | |
this.emitTasks(); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
updateStatusVars() { | ||
let tmpTasksInProgress = []; | ||
let tmpTasksInWait = []; | ||
for (let task of this.allTasks) { | ||
if ((task.status == 2 || task.status == 4 || task.status == 5) && task.lastUpdate) { | ||
if (task.eventType.startsWith("downloadDataset") && (( task.status == 2 || task.status == 4 || task.status == 5) && task.lastUpdate)) { | ||
if (Date.now() - new Date(task.lastUpdate).getTime() > this.TIMEOUT) { | ||
task.status = -1; | ||
task.message = 'timeout'; | ||
|
@@ -163,7 +163,7 @@ export class NotificationsService { | |
this.refresh(); | ||
} | ||
}); | ||
this.refresh(); | ||
this.refresh(); | ||
}); | ||
} | ||
|
||
|
@@ -174,7 +174,7 @@ export class NotificationsService { | |
pushLocalTask(task: Task) { | ||
this.createOrUpdateTask(task.clone()); | ||
} | ||
|
||
private createOrUpdateTask(task: Task) { | ||
this.newLocalTasksQueue = this.newLocalTasksQueue.filter(t => t.id != task.id); | ||
this.newLocalTasksQueue.push(task); | ||
|
@@ -219,4 +219,4 @@ export class NotificationsService { | |
this.tasksInProgress.forEach(task => total += task.progress); | ||
return total/this.tasksInProgress.length; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would break the retry functionality imo.
I'm working on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I did not think of this. Maybe you were right, this upper folder is not the greatest idea