Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): finished outbox rows and old PR cache files are pruned #16247

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/16247/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 159 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
61 additions and 0 deletionsapps/server/src/orchestration-v2/EffectOutbox.tsModified
View file
@@ -16,13 +16,17 @@
import * as Context from "effect/Context";
import * as DateTime from "effect/DateTime";
import * as Deferred from "effect/Deferred";
+import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as Queue from "effect/Queue";
+import * as Schedule from "effect/Schedule";
import * as Schema from "effect/Schema";
import * as SqlClient from "effect/sql/SqlClient";
​
+import { forkParked } from "../serverActivation.ts";
+​
export const OrchestrationEffectRequestV2 = Schema.Union([
Schema.Struct({
type: Schema.Literal("provider-runtime.continue"),
@@ -132,6 +136,21 @@
]);
export type OrchestrationEffectStatusV2 = typeof OrchestrationEffectStatusV2.Type;
​
+/**
+ * How long a succeeded or cancelled effect row is kept after it completes.
+ * Claiming, recovery, the orchestrator and storage cleanup only ask whether a
+ * row is pending, running or failed, so a missing succeeded or cancelled row
+ * reads the same as a present one. Its one other use is deduplication: `enqueue`
+ * ignores an id that already exists, and ids are deterministic per command or
+ * run. Command retries are deduplicated by their receipts first, and a run's