mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
sending ws messages doesn't need await
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user