modified to use events, hopefully will fix the crashing particle

This commit is contained in:
Martin Donnelly 2016-02-12 16:35:34 +00:00
parent 40f260c244
commit 1beedc8bf5

View File

@ -59,16 +59,12 @@ function closeDB() {
}
function insertTempReading(time, reading) {
logger.log('Inserting reading:' + reading);
logger.debug('Inserting reading:' + reading);
// var sql = db.prepare('INSERT into temperature(date, reading) VALUES
// (?,?)',[time],[reading]);
temp_db.run('BEGIN TRANSACTION');
temp_db.run('INSERT into temp(date, reading) VALUES (?,?);', [time, reading]);
// temp_db.run('END');
temp_db.run('commit');
}