Skip to content

Commit

Permalink
more tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
kevodwyer committed Dec 16, 2024
1 parent d464852 commit f5f05e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/js/opfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getOPFSKV(filename, directory) {
});
}
}).catch(e => {
postMessage({filename: filename, contents: null});
postMessage({filename: filename, contents: null, readFailure: true});
});
}
function setOPFSKV(filename, value, directory, retryCount) {
Expand All @@ -46,7 +46,7 @@ function setOPFSKV(filename, value, directory, retryCount) {
}).catch(e => {
console.log('setOPFSKV error: ' + e + " filename:" + filename);
if (retryCount < 5) {
setTimeout(() => setOPFSKV(filename, value, directory, retryCount + 1), 300);
setTimeout(() => setOPFSKV(filename, value, directory, retryCount + 1), 500);
}
});
}
Expand All @@ -56,8 +56,8 @@ function getFileHandle(filename, directory) {
.then(dirHandle => dirHandle.getDirectoryHandle(blockFolder)
.then(blockDirHandle => blockDirHandle.getFileHandle(filename))
).catch(e => {
//console.log('getFileHandle error: ' + e);
postMessage({filename: filename, contents: null});
console.log('getFileHandle error: ' + e);
postMessage({filename: filename, contents: null, readFailure: true});
});
}
function getParentDirectoryHandle(filename, directory) {
Expand Down

0 comments on commit f5f05e1

Please sign in to comment.