@opengeni/worker-bundle 0.26.0-canary.2 → 0.26.0-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10122,6 +10122,13 @@ async function refreshQueuedTurnsGauge(db, observability, countQueuedTurnsFn, re
|
|
|
10122
10122
|
}
|
|
10123
10123
|
|
|
10124
10124
|
// src/activities/workflow-wake.ts
|
|
10125
|
+
import {
|
|
10126
|
+
fireWorkspacePauseTimerInTransaction,
|
|
10127
|
+
listDueWorkspacePauseTimers,
|
|
10128
|
+
withWorkspaceRls,
|
|
10129
|
+
getWorkspaceControlEvent
|
|
10130
|
+
} from "@opengeni/db";
|
|
10131
|
+
import { publishDurableWorkspaceControlEvent } from "@opengeni/events";
|
|
10125
10132
|
var BATCH_SIZE = 1e3;
|
|
10126
10133
|
var MAX_DELIVERIES_PER_ACTIVITY = 1e4;
|
|
10127
10134
|
var MAX_TITLE_FANOUT_PER_ACTIVITY = 1e3;
|
|
@@ -10129,6 +10136,35 @@ function createWorkflowWakeActivities(services) {
|
|
|
10129
10136
|
return {
|
|
10130
10137
|
async dispatchSessionWorkflowWakes() {
|
|
10131
10138
|
const service = await services();
|
|
10139
|
+
const timers = await listDueWorkspacePauseTimers(service.db, 100);
|
|
10140
|
+
for (const timer of timers) {
|
|
10141
|
+
try {
|
|
10142
|
+
const result = await withWorkspaceRls(
|
|
10143
|
+
service.db,
|
|
10144
|
+
timer.workspace_id,
|
|
10145
|
+
(scoped) => scoped.transaction(
|
|
10146
|
+
(tx) => fireWorkspacePauseTimerInTransaction(tx, {
|
|
10147
|
+
workspaceId: timer.workspace_id,
|
|
10148
|
+
timerId: timer.timer_id
|
|
10149
|
+
})
|
|
10150
|
+
)
|
|
10151
|
+
);
|
|
10152
|
+
if (result?.workspaceControlEventId) {
|
|
10153
|
+
const event = await getWorkspaceControlEvent(
|
|
10154
|
+
service.db,
|
|
10155
|
+
timer.workspace_id,
|
|
10156
|
+
result.workspaceControlEventId
|
|
10157
|
+
);
|
|
10158
|
+
if (event)
|
|
10159
|
+
await publishDurableWorkspaceControlEvent(service.bus, timer.workspace_id, event);
|
|
10160
|
+
}
|
|
10161
|
+
} catch (error) {
|
|
10162
|
+
service.observability.warn("Workspace pause timer will retry", {
|
|
10163
|
+
workspaceId: timer.workspace_id,
|
|
10164
|
+
error: String(error)
|
|
10165
|
+
});
|
|
10166
|
+
}
|
|
10167
|
+
}
|
|
10132
10168
|
let claimed = 0;
|
|
10133
10169
|
let delivered = 0;
|
|
10134
10170
|
let failed = 0;
|
|
@@ -10200,4 +10236,4 @@ export {
|
|
|
10200
10236
|
createControlActivities,
|
|
10201
10237
|
createControlActivitiesFromServices
|
|
10202
10238
|
};
|
|
10203
|
-
//# sourceMappingURL=activities-control-
|
|
10239
|
+
//# sourceMappingURL=activities-control-SHMDOQWS.js.map
|