Feat: make lamassu-migrate use async local storage

This commit is contained in:
csrapr 2021-03-02 17:33:47 +00:00 committed by Josh Harvey
parent 351d170c31
commit 7bbf2829de
5 changed files with 26 additions and 26 deletions

View file

@ -91,7 +91,7 @@ eventBus.subscribe('log', args => {
(id, device_id, message, log_level, meta) values ($1, $2, $3, $4, $5) returning *`
// need to set AsyncLocalStorage (ALS) for this function as well
// because this module is imported before ALS is set up on app.js
const store = defaultStore(true)
const store = defaultStore()
asyncLocalStorage.run(store, () => {
db.$one(sql, [uuid.v4(), '', msgToSave, level, meta])
.then(_.mapKeys(_.camelCase))