@@ -20,12 +20,8 @@ import {
2020} from "./restart-sentinel-store.js" ;
2121
2222export type {
23- RestartSentinel ,
2423 RestartSentinelContinuation ,
25- RestartSentinelEnvelope ,
2624 RestartSentinelPayload ,
27- RestartSentinelStats ,
28- RestartSentinelStep ,
2925} from "./restart-sentinel-store.js" ;
3026
3127const sentinelLog = createSubsystemLogger ( "restart-sentinel" ) ;
@@ -54,27 +50,6 @@ function cloneRestartSentinelPayload(payload: RestartSentinelPayload): RestartSe
5450 return structuredClone ( payload ) ;
5551}
5652
57- export async function rewriteRestartSentinelIfRevision (
58- expectedRevision : number ,
59- rewrite : ( payload : RestartSentinelPayload ) => RestartSentinelPayload | null ,
60- env : NodeJS . ProcessEnv = process . env ,
61- ) : Promise < RestartSentinel | null > {
62- return runOpenClawStateWriteTransaction (
63- ( { db } ) => {
64- const current = readRestartSentinelRowSync ( db ) ;
65- if ( current . kind !== "valid" || current . sentinel . revision !== expectedRevision ) {
66- return null ;
67- }
68- const nextPayload = rewrite ( cloneRestartSentinelPayload ( current . sentinel . payload ) ) ;
69- return nextPayload
70- ? writeRestartSentinelRowIfRevisionSync ( db , nextPayload , expectedRevision )
71- : null ;
72- } ,
73- { env } ,
74- { operationLabel : "restart-sentinel.rewrite" } ,
75- ) ;
76- }
77-
7853async function rewriteRestartSentinel (
7954 rewrite : ( payload : RestartSentinelPayload ) => RestartSentinelPayload | null ,
8055 env : NodeJS . ProcessEnv = process . env ,
0 commit comments