Skip to content

Commit

Permalink
unify retry timers
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Nov 14, 2024
1 parent b08a52e commit eda358d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,17 @@ async function callEnqueueAndParse<T extends Inference>(
pageOptions: pageOptions,
allWords: predictParams.allWords,
cropper: predictParams.cropper,
initialDelaySec: 4,
delaySec: 2,
initialDelaySec: 2,
delaySec: 1.5,
maxRetries: 60,
});
} else {
response = await mindeeClient.enqueueAndParse(productClass, inputSource, {
pageOptions: pageOptions,
allWords: predictParams.allWords,
cropper: predictParams.cropper,
initialDelaySec: 4,
delaySec: 2,
initialDelaySec: 2,
delaySec: 1.5,
maxRetries: 60,
});
if (!response.document) {
Expand Down
8 changes: 4 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ export class Client {
newAsyncParams.maxRetries ??= 60;

if (newAsyncParams.delaySec < minDelaySec) {
throw Error(`Cannot set auto-parsing delay to less than ${minDelaySec} seconds.`);
throw Error(`Cannot set auto-parsing delay to less than ${minDelaySec} second(s).`);
}
if (newAsyncParams.initialDelaySec < minInitialDelay) {
throw Error(`Cannot set initial parsing delay to less than ${minInitialDelay} seconds.`);
throw Error(`Cannot set initial parsing delay to less than ${minInitialDelay} second(s).`);
}
if (newAsyncParams.maxRetries < minRetries) {
throw Error(`Cannot set retry to less than ${minRetries}.`);
Expand Down Expand Up @@ -318,8 +318,8 @@ export class Client {
fullText: undefined,
cropper: undefined,
pageOptions: undefined,
initialDelaySec: 4,
delaySec: 2,
initialDelaySec: 2,
delaySec: 1.5,
maxRetries: 60,
initialTimerOptions: undefined,
recurringTimerOptions: undefined,
Expand Down

0 comments on commit eda358d

Please sign in to comment.