@@ -9,7 +9,6 @@ import { loadModuleWith } from '../lib/loadModule.js'
99import { mapFrom } from '../utils.js'
1010import { readStateWith } from './readState.js'
1111
12- const DEFAULT_MAX_PROCESS_AGE = 100
1312/**
1413 * TODO: should this be an effect or shared util?
1514 * just keeping here for sake of locality for now
@@ -58,6 +57,8 @@ const TtlCache = ({ setTimeout, clearTimeout }) => {
5857 * @returns {ReadResult }
5958 */
6059export function dryRunWith ( env ) {
60+ const DRY_RUN_DEFAULT_MAX_PROCESS_AGE = env . DRY_RUN_DEFAULT_MAX_PROCESS_AGE
61+ const DRY_RUN_PROCESS_CACHE_TTL = env . DRY_RUN_PROCESS_CACHE_TTL
6162 const logger = env . logger
6263 const loadMessageMeta = loadMessageMetaWith ( env )
6364 const loadModule = loadModuleWith ( env )
@@ -131,7 +132,7 @@ export function dryRunWith (env) {
131132 * the overhead of maintaining the map, timers, for the specified
132133 * age
133134 */
134- readStateCache . set ( res . id , cached , 2000 )
135+ readStateCache . set ( res . id , cached , DRY_RUN_PROCESS_CACHE_TTL )
135136 return res
136137 } ) ,
137138 Resolved
@@ -157,7 +158,7 @@ export function dryRunWith (env) {
157158 return Resolved ( ctx )
158159 }
159160
160- return ( { processId, messageTxId, maxProcessAge = DEFAULT_MAX_PROCESS_AGE , dryRun } ) => {
161+ return ( { processId, messageTxId, maxProcessAge = DRY_RUN_DEFAULT_MAX_PROCESS_AGE , dryRun } ) => {
161162 return of ( { processId, messageTxId } )
162163 . chain ( loadMessageCtx )
163164 . chain ( ensureProcessLoaded ( { maxProcessAge } ) )
0 commit comments