diff options
Diffstat (limited to 'ext/wasm/tests/opfs/concurrency/worker.js')
-rw-r--r-- | ext/wasm/tests/opfs/concurrency/worker.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/wasm/tests/opfs/concurrency/worker.js b/ext/wasm/tests/opfs/concurrency/worker.js index c315508e0..19b0a068e 100644 --- a/ext/wasm/tests/opfs/concurrency/worker.js +++ b/ext/wasm/tests/opfs/concurrency/worker.js @@ -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{ |