sending ws messages doesn't need await

This commit is contained in:
zadam
2019-10-28 18:42:22 +01:00
parent 23c449ca0c
commit 5e3538669d
3 changed files with 15 additions and 15 deletions

View File

@@ -25,13 +25,13 @@ class TaskContext {
return taskContexts[taskId];
}
async increaseProgressCount() {
increaseProgressCount() {
this.progressCount++;
if (Date.now() - this.lastSentCountTs >= 300) {
this.lastSentCountTs = Date.now();
await ws.sendMessageToAllClients({
ws.sendMessageToAllClients({
type: 'task-progress-count',
taskId: this.taskId,
taskType: this.taskType,
@@ -41,8 +41,8 @@ class TaskContext {
}
}
async reportError(message) {
await ws.sendMessageToAllClients({
reportError(message) {
ws.sendMessageToAllClients({
type: 'task-error',
taskId: this.taskId,
taskType: this.taskType,
@@ -51,8 +51,8 @@ class TaskContext {
});
}
async taskSucceeded(result) {
await ws.sendMessageToAllClients({
taskSucceeded(result) {
ws.sendMessageToAllClients({
type: 'task-succeeded',
taskId: this.taskId,
taskType: this.taskType,