Increase max attempt count for unprocessed items
This commit is contained in:
parent
a80c6d89a8
commit
ecbf84638d
2 changed files with 13 additions and 3 deletions
|
@ -3209,7 +3209,10 @@ function saveUnprocessedSync(data: UnprocessedType): string {
|
|||
throw new Error('saveUnprocessedSync: id was falsey');
|
||||
}
|
||||
|
||||
if (attempts >= MAX_UNPROCESSED_ATTEMPTS) {
|
||||
if (attempts > MAX_UNPROCESSED_ATTEMPTS) {
|
||||
logger.warn(
|
||||
`saveUnprocessedSync: not saving ${id} due to exhausted attempts`
|
||||
);
|
||||
removeUnprocessedSync(id);
|
||||
return id;
|
||||
}
|
||||
|
@ -3376,7 +3379,7 @@ async function getAllUnprocessedAndIncrementAttempts(): Promise<
|
|||
.prepare<Query>(
|
||||
`
|
||||
DELETE FROM unprocessed
|
||||
WHERE attempts >= $MAX_UNPROCESSED_ATTEMPTS
|
||||
WHERE attempts > $MAX_UNPROCESSED_ATTEMPTS
|
||||
`
|
||||
)
|
||||
.run({ MAX_UNPROCESSED_ATTEMPTS });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue