Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): skip disabled settlement lookups #10313

Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/10313/headopened View on GitHub

Showing 2 changed files with 73 additions and 7 deletions.

x
0 of 2 viewed, 2 left
69 additions and 7 deletionsapps/server/src/orchestration/ThreadSettlementReactor.test.tsModified
View file
@@ -149,6 +149,7 @@
const snapshotReadCount = yield* Ref.make(0);
const snapshotReads = yield* Queue.unbounded<number>();
const settings = yield* Ref.make(options.settings ?? DEFAULT_SERVER_SETTINGS);
+ const settingsReads = yield* Queue.unbounded<ServerSettings>();
const settingsChanges = yield* PubSub.unbounded<ServerSettings>();
const mergedPullRequests = yield* PubSub.unbounded<PullRequestMergeEvent>();
const commands = yield* Ref.make<ReadonlyArray<AutoSettleCommand>>([]);
@@ -208,7 +209,7 @@
const serverSettings = ServerSettingsService.of({
start: Effect.void,
ready: Effect.void,
- getSettings: Ref.get(settings),
+ getSettings: Ref.get(settings).pipe(Effect.tap((value) => Queue.offer(settingsReads, value))),
updateSettings,
streamChanges: Stream.fromPubSub(settingsChanges),
subscribeChanges: PubSub.subscribe(settingsChanges).pipe(
@@ -253,6 +254,7 @@
snapshots,
snapshotReadCount,
snapshotReads,
+ settingsReads,
commands,
branchCalls,
summaryCalls,
@@ -281,6 +283,63 @@
});