added basic CLS support with re-entrant transactions

This commit is contained in:
azivner
2018-03-28 23:41:22 -04:00
parent b10b0048f3
commit 0ec909fd7a
13 changed files with 115 additions and 24 deletions

View File

@@ -55,7 +55,9 @@ router.put('/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
const sourceId = req.headers.source_id;
const dataKey = protected_session.getDataKey(req);
await notes.updateNote(noteId, note, dataKey, sourceId);
await sql.doInTransaction(async () => {
await notes.updateNote(noteId, note, dataKey, sourceId);
});
res.send({});
}));