aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/sqlite3-opfs-async-proxy.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/sqlite3-opfs-async-proxy.js')
-rw-r--r--ext/wasm/sqlite3-opfs-async-proxy.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/wasm/sqlite3-opfs-async-proxy.js b/ext/wasm/sqlite3-opfs-async-proxy.js
index b951873ea..0abc3ee23 100644
--- a/ext/wasm/sqlite3-opfs-async-proxy.js
+++ b/ext/wasm/sqlite3-opfs-async-proxy.js
@@ -609,7 +609,11 @@ const waitLoop = async function f(){
now - relinquishTime >= fh.syncHandleTime
)){
//warn("Relinquishing for timeout:",fh.filenameAbs);
- closeSyncHandle(fh)/*async!*/;
+ await closeSyncHandle(fh)
+ /* Testing shows that we have to wait on this async
+ op to finish, else we might try to re-open it
+ before the close has run. The FS layer does not
+ retain the order those operations, apparently. */;
}
}
}