Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): skip no-op settlement decisions #27897

Mergedomar7550(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/27897/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 56 additions and 3 deletions.

x
0 of 2 viewed, 2 left
36 additions and 1 deletionapps/server/src/orchestration-v2/ThreadSettlementService.test.tsModified
View file
@@ -571,6 +571,7 @@
const snapshotReads = yield* Queue.unbounded<number>();
const candidateReads = yield* Ref.make<ReadonlyArray<string | undefined>>([]);
const settings = yield* Ref.make(options.settings ?? DEFAULT_SERVER_SETTINGS);
+ const settingsReadCount = yield* Ref.make(0);
const settingsChanges = yield* PubSub.unbounded<ContractServerSettings>();
const mergedPullRequests = yield* PubSub.unbounded<PullRequestService.PullRequestMergeEvent>();
const commands = yield* Ref.make<ReadonlyArray<AutoSettleCommand>>([]);
@@ -640,7 +641,9 @@
const serverSettings = ServerSettings.ServerSettingsService.of({
start: Effect.void,
ready: Effect.void,
- getSettings: Ref.get(settings),
+ getSettings: Ref.update(settingsReadCount, (count) => count + 1).pipe(
+ Effect.andThen(Ref.get(settings)),
+ ),
updateSettings,
updateProviderInstance: () => Effect.die("Unexpected provider mutation"),
withSettingsSnapshot: (use) => Ref.get(settings).pipe(Effect.flatMap(use)),
@@ -710,6 +713,7 @@
activation,
snapshots,
snapshotReadCount,
+ settingsReadCount,
snapshotReads,
candidateReads,
commands,