Commit 635ca11d authored by ac32's avatar ac32

sets WAL mode before batch seg

parent fd5147f6
......@@ -1297,8 +1297,16 @@ class LeverDB {
fnCallback(vertices);
});
}
// set write ahead mode on the database -- makes concurrent access possible
setWAL(fnCallback) {
var sqlCmd = "PRAGMA journal_mode = WAL";
this._lDB.exec(sqlCmd,function(){
fnCallback();
});
}
} // class leverDB
}
// read all the leverfiles in a folder, send one massive response
// unused, since it takes
// note - currently unused...
......
......@@ -64,7 +64,7 @@ function checkToProcessQ()
internalAddToQ(leverCommand[0]);
}
}
toProcessQtimer=setTimeout(checkToProcessQ,1000);
toProcessQtimer=setTimeout(checkToProcessQ,2000);
} // checkToProcessQ
var toProcessQtimer;
......@@ -232,6 +232,7 @@ function getUserID(leverCommand,fnCallback)
if (undefined!==fnCallback)
fnCallback(userID);
}
leverDB.close();
});
});
}
......@@ -241,6 +242,7 @@ function getUserID(leverCommand,fnCallback)
userID=rows[0].userID;
if (undefined!==fnCallback)
fnCallback(userID);
leverDB.close();
}
});
......@@ -351,7 +353,12 @@ function addFiletoBatchSeg(leverCommand,nSlot)
function addFileToProcess(leverCommand,nSlot)
{
if ("batchSeg"==leverCommand.command){
addFiletoBatchSeg(leverCommand,nSlot);
const LeverDB=require('./lever.js');
var leverDB=new LeverDB(leverCommand.leverFile);
leverDB.setWAL(function(){
addFiletoBatchSeg(leverCommand,nSlot);
leverDB.close();
});
return;
}
const path=require('path');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment