1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Resolve missing SQLITE_LOCKED result code which triggered a new (since last checkin) exception in the OPFS VFS. Improve output of the OPFS contention tester app.

FossilOrigin-Name: 2debbbca33bd4170a1dc4dbb5eb3e68523e51d289b06c551e5560ac4e32e433b
This commit is contained in:
stephan
2022-11-21 04:12:38 +00:00
parent 27c4cd183d
commit 36d5554c9a
6 changed files with 36 additions and 25 deletions

View File

@ -26,7 +26,7 @@ self.sqlite3InitModule().then(async function(sqlite3){
wPost('loaded');
const run = async function(){
const db = new sqlite3.opfs.OpfsDb(dbName);
const db = new sqlite3.opfs.OpfsDb(dbName,'c');
//sqlite3.capi.sqlite3_busy_timeout(db.pointer, 2000);
db.transaction((db)=>{
db.exec([
@ -37,7 +37,7 @@ self.sqlite3InitModule().then(async function(sqlite3){
const maxIterations = 10;
const interval = Object.assign(Object.create(null),{
delay: 300,
delay: 500,
handle: undefined,
count: 0
});
@ -58,9 +58,13 @@ self.sqlite3InitModule().then(async function(sqlite3){
}
};
const finish = ()=>{
if(interval.error) stderr("Ending work due to error:",e.message);
else stdout("Ending work after",interval.count,"interval(s)");
db.close();
if(interval.error){
wPost('failed',"Ending work after interval #"+interval.count,
"due to error:",interval.error);
}else{
wPost('finished',"Ending work after",interval.count,"intervals.");
}
};
if(1){/*use setInterval()*/
interval.handle = setInterval(async ()=>{