synchronization of transactions using promise so only one can be active

This commit is contained in:
azivner
2017-11-28 17:24:08 -05:00
parent fd764f6163
commit 3d84f5c3b0
20 changed files with 194 additions and 180 deletions

View File

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