diff options
author | stephan <stephan@noemail.net> | 2022-11-23 15:33:49 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-11-23 15:33:49 +0000 |
commit | 3eaaec945c4cc3b35e9bd3c0f9a133c7f94cae1f (patch) | |
tree | 73aba45df3c772667c3d45d00f44b94fcd0e7f91 /ext/wasm/tests/opfs/concurrency/worker.js | |
parent | c62052217504fe651505328c32ea024c554e8a08 (diff) | |
download | sqlite-3eaaec945c4cc3b35e9bd3c0f9a133c7f94cae1f.tar.gz sqlite-3eaaec945c4cc3b35e9bd3c0f9a133c7f94cae1f.zip |
OPFS concurrency tester: ensure that the work interval timer does not overlap with the work time.
FossilOrigin-Name: 8f2076553bc486ea6a17934695ecc02217461af2082d891697b62aab89bd1b43
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{ |