Skip to content

Commit

Permalink
Merge pull request #13 from voxoco/fix-simul-backup
Browse files Browse the repository at this point in the history
add a small random backoff timeout
  • Loading branch information
jmordica committed Jan 24, 2023
2 parents 78d5ad4 + 7b9a4c3 commit 117200b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ export class Nqlite {
setTimeout(resolve, this.snapInterval * 60 * 60 * 1000)
);

// Now wait for a random amount of time between 1 and 5 minutes
await new Promise((resolve) => setTimeout(resolve, Math.random() * 5 * 60 * 1000));

this.inSnapShot = true;

try {
Expand Down

0 comments on commit 117200b

Please sign in to comment.