Prevent database is locked errors
Since there are only SELECT statements, the database can be opened as read-only preventing: Error: SQLITE_BUSY: database is locked at Error (native)pull/1/head
rodzic
6bf525f98b
commit
6e556afede
4
httpd.js
4
httpd.js
|
@ -7,7 +7,7 @@ var moment = require('moment');
|
|||
var express = require("express");
|
||||
|
||||
var app = express();
|
||||
var db = new sqlite3.Database(DB_FILE);
|
||||
var db = new sqlite3.Database(DB_FILE, sqlite3.OPEN_READONLY));
|
||||
|
||||
var isValidChart = function(s) {
|
||||
return /^(net_in|net_out|block_in|block_out|mem)$/.test(s);
|
||||
|
@ -114,4 +114,4 @@ app.get("/rs/all/:chart/:zoom", function(req, res) {
|
|||
|
||||
app.listen(8080, function() {
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue