Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions apps/server/src/orchestration/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ export type OrchestrationEngineError =
| OrchestrationCommandJsonParseError
| OrchestrationCommandDecodeError;

export function toOrchestrationCommandDecodeError(error: Schema.SchemaError) {
return new OrchestrationCommandDecodeError({
issue: SchemaIssue.makeFormatterDefault()(error.issue),
cause: error,
});
}

export function toProjectorDecodeError(eventType: string) {
return (error: Schema.SchemaError): OrchestrationProjectorDecodeError =>
new OrchestrationProjectorDecodeError({
Expand All @@ -141,19 +134,3 @@ export function toProjectorDecodeError(eventType: string) {
cause: error,
});
}

export function toOrchestrationJsonParseError(cause: unknown) {
return new OrchestrationCommandJsonParseError({
detail: `Failed to parse orchestration command JSON`,
cause,
});
}

export function toListenerCallbackError(listener: "read-model" | "domain-event") {
return (cause: unknown): OrchestrationListenerCallbackError =>
new OrchestrationListenerCallbackError({
listener,
detail: `Failed to invoke orchestration ${listener} listener`,
cause,
});
}
4 changes: 2 additions & 2 deletions apps/server/src/orchestration/LiveStreamBudget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import * as Exit from "effect/Exit";
import * as Scope from "effect/Scope";
import * as Stream from "effect/Stream";

export const LIVE_STREAM_MAX_ITEMS = 1_000;
export const LIVE_STREAM_MAX_SERIALIZED_BYTES = 8 * 1024 * 1024;
const LIVE_STREAM_MAX_ITEMS = 1_000;
const LIVE_STREAM_MAX_SERIALIZED_BYTES = 8 * 1024 * 1024;

export interface RetainedLiveItem<A> {
readonly value: A;
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/orchestration/ThreadPullRequestReactor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function pullRequestMatchesProject(
);
}

/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const engine = yield* OrchestrationEngine.OrchestrationEngineService;
const snapshots = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/orchestration/ThreadSettlementPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface SettlementPullRequest {
}

const DAY_MS = 24 * 60 * 60 * 1_000;
export const QUEUED_TURN_START_GRACE_MS = 2 * 60 * 1_000;
const QUEUED_TURN_START_GRACE_MS = 2 * 60 * 1_000;

function latestTimestamp(values: ReadonlyArray<string | null | undefined>): string | null {
let latest: string | null = null;
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/orchestration/ThreadSettlementReactor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class ThreadSettlementReactor extends Context.Service<
}
>()("t3/orchestration/ThreadSettlementReactor") {}

/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const engine = yield* OrchestrationEngine.OrchestrationEngineService;
const snapshots = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/orchestration/commandInvariants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function findThreadById(
return readModel.threads.find((thread) => thread.id === threadId);
}

export function findProjectById(
function findProjectById(
readModel: OrchestrationReadModel,
projectId: ProjectId,
): OrchestrationProject | undefined {
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/orchestration/runtimeLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import { OrchestrationProjectionSnapshotQueryLive } from "./Layers/ProjectionSna
import * as ThreadBackgroundLiveness from "./ThreadBackgroundLiveness.ts";
import * as ThreadPlanProgress from "./ThreadPlanProgress.ts";

export const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
OrchestrationEventStoreLive,
OrchestrationCommandReceiptRepositoryLive,
);

export const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
Layer.provide(OrchestrationEventStoreLive),
);

export const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
OrchestrationProjectionSnapshotQueryLive,
OrchestrationEventInfrastructureLayerLive,
OrchestrationProjectionPipelineLayerLive,
Expand Down
Loading