1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Adjust automatic OPFS locking retries such that they will wait up to a total of 3 seconds spanning 4 attempts.

FossilOrigin-Name: bbce49d81abc491ca666474040a53057e26e99131fea9449de253f88f4415ded
This commit is contained in:
stephan
2022-10-30 10:24:53 +00:00
parent 1fc6ffccc5
commit 9163ef1f4d
3 changed files with 10 additions and 10 deletions

View File

@ -150,9 +150,9 @@ const getSyncHandle = async (fh)=>{
if(!fh.syncHandle){
const t = performance.now();
log("Acquiring sync handle for",fh.filenameAbs);
const maxTries = 3;
let i = 1, ms = 300;
for(; true; ms *= ++i){
const maxTries = 4, msBase = 300;
let i = 1, ms = msBase;
for(; true; ms = msBase * ++i){
try {
//if(i<3) toss("Just testing.");
//TODO? A config option which tells it to throw here