1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

OPFS concurrency tester: ensure that the work interval timer does not overlap with the work time.

FossilOrigin-Name: 8f2076553bc486ea6a17934695ecc02217461af2082d891697b62aab89bd1b43
This commit is contained in:
stephan
2022-11-23 15:33:49 +00:00
parent c620522175
commit 3eaaec945c
3 changed files with 11 additions and 10 deletions

View File

@ -70,11 +70,12 @@ self.sqlite3InitModule().then(async function(sqlite3){
}
};
if(1){/*use setInterval()*/
interval.handle = setInterval(async ()=>{
setTimeout(async function timer(){
await doWork();
if(interval.error || maxIterations === interval.count){
clearInterval(interval.handle);
finish();
}else{
setTimeout(timer, interval.delay);
}
}, interval.delay);
}else{