mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
Updated file access, so the db can be queried while an agent is still active
This commit is contained in:
@@ -16,13 +16,29 @@ limitations under the License.
|
||||
|
||||
|
||||
var db;
|
||||
var readonlyDb = true;
|
||||
|
||||
if (process.argv.length > 1)
|
||||
{
|
||||
switch (process.argv[1])
|
||||
{
|
||||
case 'compact':
|
||||
case 'put':
|
||||
case 'putx':
|
||||
case 'delete':
|
||||
case 'import':
|
||||
readonlyDb = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform == 'win32')
|
||||
{
|
||||
db = require('SimpleDataStore').Create(process.execPath.replace('.exe', '.db'));
|
||||
db = require('SimpleDataStore').Create(process.execPath.replace('.exe', '.db'), { readOnly: readonlyDb });
|
||||
}
|
||||
else
|
||||
{
|
||||
db = require('SimpleDataStore').Create(process.execPath + '.db');
|
||||
db = require('SimpleDataStore').Create(process.execPath + '.db', { readOnly: readonlyDb });
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user