Skip to content

Commit

Permalink
Update processing state before we start processing
Browse files Browse the repository at this point in the history
this prevent parallel workers from picking up duplicate work
  • Loading branch information
sunu committed Apr 18, 2024
1 parent 145be42 commit e95f646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion update.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const process = async () => {
// Now check the queue and pick a file to process
let toProcess = await getReplicationToProcess();
while (toProcess) {
await setProcessedState(toProcess);
console.log(`Processing replication file ${toProcess}`);
await run(toProcess);
console.log(`Finished processing replication file ${toProcess}`);
await setProcessedState(toProcess);
toProcess = await getReplicationToProcess();
}
};
Expand Down

0 comments on commit e95f646

Please sign in to comment.