Skip to content

Commit

Permalink
This works for me and resolve askmike#1189
Browse files Browse the repository at this point in the history
  • Loading branch information
xerix32 committed Oct 21, 2017
1 parent 6d1340f commit 91ed5de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/sqlite/handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if(mode === 'realtime' || mode === 'importer') {
}

var db = new sqlite3.Database(fullPath);
db.run('PRAGMA journal_mode = ' + config.sqlite.journalMode||'WAL');
db.run("PRAGMA journal_mode = WAL");
db.configure('busyTimeout', 1500);

module.exports = db;
9 changes: 8 additions & 1 deletion plugins/sqlite/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ var config = require('../../core/util.js').getConfig();

var handle = require('./handle');
var sqliteUtil = require('./util');
var util = require('../../core/util');
var log = require('../../core/log');

var Store = function(done, pluginMeta) {
_.bindAll(this);
Expand Down Expand Up @@ -52,7 +54,12 @@ Store.prototype.writeCandles = function() {
var stmt = this.db.prepare(`
INSERT OR IGNORE INTO ${sqliteUtil.table('candles')}
VALUES (?,?,?,?,?,?,?,?,?)
`);
`, function(err, rows) {
if(err) {
log.error(err);
return util.die('DB error at INSERT: '+ err);
}
});

_.each(this.cache, candle => {
stmt.run(
Expand Down

0 comments on commit 91ed5de

Please sign in to comment.