separate DB connection for each transaction (just for the record, will be reverted probably)

This commit is contained in:
azivner
2017-11-28 17:04:47 -05:00
parent 4d95eb0762
commit fd764f6163
21 changed files with 326 additions and 429 deletions

View File

@@ -2,12 +2,12 @@ const sql = require('./sql');
const utils = require('./utils');
const log = require('./log');
async function addEvent(comment) {
await addNoteEvent(null, comment);
async function addEvent(db, comment) {
await addNoteEvent(db, null, comment);
}
async function addNoteEvent(noteId, comment) {
await sql.insert('event_log', {
async function addNoteEvent(db, noteId, comment) {
await sql.insert(db, 'event_log', {
note_id : noteId,
comment: comment,
date_added: utils.nowTimestamp()