@@ -12,17 +12,19 @@ const DEFAULT_WORKER_CAPACITY = 5;
1212type Args = {
1313 _ : string [ ] ;
1414 backoff : string ;
15- debug ?: boolean ;
1615 capacity ?: number ;
16+ claimTimeoutSeconds ?: number ;
1717 collectionsUrl ?: string ;
1818 collectionsVersion ?: string ;
19- engineValidationTimeoutMs ?: number ;
19+ debug ?: boolean ;
2020 engineValidationRetries ?: number ;
21+ engineValidationTimeoutMs ?: number ;
2122 lightning ?: string ;
2223 lightningPublicKey ?: string ;
2324 log ?: LogLevel ;
2425 loop ?: boolean ;
2526 maxRunDurationSeconds : number ;
27+ messageTimeoutSeconds ?: number ;
2628 mock ?: boolean ;
2729 monorepoDir ?: string ;
2830 payloadMemory ?: number ;
@@ -32,12 +34,12 @@ type Args = {
3234 repoDir ?: string ;
3335 runMemory ?: number ;
3436 secret ?: string ;
35- socketTimeoutSeconds ?: number ; // deprecated
36- messageTimeoutSeconds ?: number ;
37- claimTimeoutSeconds ?: number ;
38- statePropsToRemove ?: string [ ] ;
3937 sentryDsn ?: string ;
4038 sentryEnv ?: string ;
39+ socketTimeoutSeconds ?: number ; // deprecated
40+ statePropsToRemove ?: string [ ] ;
41+ timeoutRetryCount ?: number ;
42+ timeoutRetryDelayMs ?: number ;
4143} ;
4244
4345type ArgTypes = string | string [ ] | number | boolean | undefined ;
@@ -82,14 +84,16 @@ export default function parseArgs(argv: string[]): Args {
8284 WORKER_MAX_RUN_MEMORY_MB ,
8385 WORKER_MESSAGE_TIMEOUT_SECONDS ,
8486 WORKER_PORT ,
85- WORKER_PROFILE ,
8687 WORKER_PROFILE_POLL_INTERVAL_MS ,
88+ WORKER_PROFILE ,
8789 WORKER_REPO_DIR ,
8890 WORKER_SECRET ,
8991 WORKER_SENTRY_DSN ,
9092 WORKER_SENTRY_ENV ,
9193 WORKER_SOCKET_TIMEOUT_SECONDS ,
9294 WORKER_STATE_PROPS_TO_REMOVE ,
95+ WORKER_TIMEOUT_RETRY_COUNT ,
96+ WORKER_TIMEOUT_RETRY_DELAY_MS ,
9397 WORKER_VALIDATION_RETRIES ,
9498 WORKER_VALIDATION_TIMEOUT_MS ,
9599 } = process . env ;
@@ -219,6 +223,16 @@ export default function parseArgs(argv: string[]): Args {
219223 description :
220224 'Interval for polling profile data, in milliseconds. Default 10. Env: WORKER_PROFILE_POLL_INTERVAL_MS' ,
221225 type : 'number' ,
226+ } )
227+ . option ( 'timeout-retry-count' , {
228+ description :
229+ 'When a websocket event receives a timeout, this option sets how many times the worker should retry it. Default 10. Env: WORKER_TIMEOUT_RETRY_COUNT' ,
230+ type : 'number' ,
231+ } )
232+ . option ( 'timeout-retry-delay' , {
233+ description :
234+ 'When a websocket event receives a timeout, this option sets how log to wait before retrying Default 30000. Env: WORKER_TIMEOUT_RETRY_DELAY_MS' ,
235+ type : 'number' ,
222236 } ) ;
223237
224238 const args = parser . parse ( ) as Args ;
@@ -289,5 +303,15 @@ export default function parseArgs(argv: string[]): Args {
289303 WORKER_PROFILE_POLL_INTERVAL_MS ,
290304 10
291305 ) ,
306+ timeoutRetryCount : setArg (
307+ args . timeoutRetryCount ,
308+ WORKER_TIMEOUT_RETRY_COUNT ,
309+ 10
310+ ) ,
311+ timeoutRetryDelayMs : setArg (
312+ args . timeoutRetryDelayMs ,
313+ WORKER_TIMEOUT_RETRY_DELAY_MS ,
314+ 30 * 1000
315+ ) ,
292316 } as Args ;
293317}
0 commit comments