Skip to content

Commit

Permalink
feat: queue add and remove listener operations
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldas committed Jun 12, 2024
1 parent 1c08db8 commit 5702eb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/modules/document/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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}`);
Expand Down

0 comments on commit 5702eb8

Please sign in to comment.