From 5702eb894f6cc1326a6d01d31205b5179be0dd11 Mon Sep 17 00:00:00 2001 From: acaldas Date: Wed, 12 Jun 2024 10:21:08 +0100 Subject: [PATCH] feat: queue add and remove listener operations --- api/src/modules/document/model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/modules/document/model.ts b/api/src/modules/document/model.ts index db0a2142..3e52225e 100644 --- a/api/src/modules/document/model.ts +++ b/api/src/modules/document/model.ts @@ -206,7 +206,7 @@ export function getDocumentDriveCRUD(prisma: Prisma.TransactionClient) { system: false, }; - const result = await driveServer.addDriveAction(driveId, actions.addListener({ listener })); + const result = await driveServer.queueDriveAction(driveId, actions.addListener({ listener })); if (result.status !== "SUCCESS") { result.error && logger.error(result.error); throw new Error(`Listener couldn't be registered: ${result.error || result.status}`); @@ -219,7 +219,7 @@ export function getDocumentDriveCRUD(prisma: Prisma.TransactionClient) { driveId: string, listenerId: string, ) => { - const result = await driveServer.addDriveAction(driveId, actions.removeListener({ listenerId })); + const result = await driveServer.queueDriveAction(driveId, actions.removeListener({ listenerId })); if (result.status !== "SUCCESS") { result.error && logger.error(result.error); throw new Error(`Listener couldn't be deleted: ${result.error || result.status}`);