UBERF-7532: Bulk operations for triggers (#6023)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-07-09 00:04:05 +07:00
committed by GitHub
parent fa82ee1939
commit 4eac1927f0
49 changed files with 656 additions and 693 deletions
@@ -242,8 +242,7 @@ export class InboxNotificationsClientImpl implements InboxNotificationsClient {
}
async archiveAllNotifications (): Promise<void> {
const doneOp = await getClient().measure('archiveAllNotifications')
const ops = getClient().apply(generateId())
const ops = getClient().apply(generateId(), 'archiveAllNotifications')
try {
const inboxNotifications = await ops.findAll(
@@ -264,13 +263,11 @@ export class InboxNotificationsClientImpl implements InboxNotificationsClient {
}
} finally {
await ops.commit()
await doneOp()
}
}
async readAllNotifications (): Promise<void> {
const doneOp = await getClient().measure('readAllNotifications')
const ops = getClient().apply(generateId())
const ops = getClient().apply(generateId(), 'readAllNotifications')
try {
const inboxNotifications = await ops.findAll(
@@ -291,13 +288,11 @@ export class InboxNotificationsClientImpl implements InboxNotificationsClient {
}
} finally {
await ops.commit()
await doneOp()
}
}
async unreadAllNotifications (): Promise<void> {
const doneOp = await getClient().measure('unreadAllNotifications')
const ops = getClient().apply(generateId())
const ops = getClient().apply(generateId(), 'unreadAllNotifications')
try {
const inboxNotifications = await ops.findAll(
@@ -332,7 +327,6 @@ export class InboxNotificationsClientImpl implements InboxNotificationsClient {
}
} finally {
await ops.commit()
await doneOp()
}
}
}