mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-02 16:58:52 +01:00
Preserve company reconstruction for graph, run and eligibility changes. A real PostgreSQL producer regression verifies one assignment check among1000 open tasks, with broader eligibility reconstruction still intact. Co-Authored-By: Paperclip <noreply@paperclip.ing>
12 lines
648 B
TypeScript
12 lines
648 B
TypeScript
import { notifyIssueRecovery } from "./issue-recovery-notifications.js";
|
|
import { DELIVERY_QUEUES, notifyDeliveryWork } from "./delivery-work-notifications.js";
|
|
|
|
export type RunDispatchScope = { companyId: string };
|
|
|
|
export async function notifyRunDispatch(transaction: object, scope?: RunDispatchScope) {
|
|
await notifyIssueRecovery(transaction, scope ? { companyId: scope.companyId } : undefined);
|
|
const hint = scope ? JSON.stringify({ companyId: scope.companyId }) : "*";
|
|
await notifyDeliveryWork(transaction, DELIVERY_QUEUES.scheduledRetryDispatch, hint);
|
|
await notifyDeliveryWork(transaction, DELIVERY_QUEUES.queuedRunDispatch, hint);
|
|
}
|