diff options
Diffstat (limited to 'ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js')
-rw-r--r-- | ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js index 199ac7d61..2a0471e25 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -1225,13 +1225,19 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ throw options.$testThrowPhase1; } if(initPromises[vfsName]){ - const p = initPromises[vfsName]; - if( (p instanceof OpfsSAHPool) || !options.forceReinitIfFailed ){ - //log("Returning cached installOpfsSAHPoolVfs() result",options,vfsName,initPromises[vfsName]); + try { + const p = await initPromises[vfsName]; + //log("installOpfsSAHPoolVfs() returning cached result",options,vfsName,p); return p; + }catch(e){ + //log("installOpfsSAHPoolVfs() got cached failure",options,vfsName,e); + if( options.forceReinitIfFailed ){ + delete initPromises[vfsName]; + /* Fall through and try again. */ + }else{ + throw e; + } } - delete initPromises[vfsName]; - /* Fall through and try again. */ } if(!globalThis.FileSystemHandle || !globalThis.FileSystemDirectoryHandle || |