From f61c1c1bc745f65664af689dc93673372a72524e Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 5 Sep 2024 22:37:34 -0400 Subject: [PATCH] refactor(cosmic-swingset): Clarify keep{Snapshots,Transcripts} determination --- packages/cosmic-swingset/src/chain-main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/cosmic-swingset/src/chain-main.js b/packages/cosmic-swingset/src/chain-main.js index cb56f8ec0aeb..c1c3427e0d4d 100644 --- a/packages/cosmic-swingset/src/chain-main.js +++ b/packages/cosmic-swingset/src/chain-main.js @@ -317,10 +317,12 @@ export default async function main(progname, args, { env, homedir, agcc }) { validateSwingsetConfig(swingsetConfig); const { slogfile, vatSnapshotRetention, vatTranscriptRetention } = swingsetConfig; - const keepSnapshots = - vatSnapshotRetention === 'debug' || - (!vatSnapshotRetention && ['1', 'true'].includes(XSNAP_KEEP_SNAPSHOTS)); - const keepTranscripts = vatTranscriptRetention === 'archival'; + const keepSnapshots = vatSnapshotRetention + ? vatSnapshotRetention !== 'operational' + : ['1', 'true'].includes(XSNAP_KEEP_SNAPSHOTS); + const keepTranscripts = vatTranscriptRetention + ? vatTranscriptRetention !== 'operational' + : false; // As a kludge, back-propagate selected configuration into environment variables. // eslint-disable-next-line dot-notation