diff --git a/src/models/BagItem.ts b/src/models/BagItem.ts index 8d2ef77..e4e6fb4 100644 --- a/src/models/BagItem.ts +++ b/src/models/BagItem.ts @@ -88,8 +88,13 @@ class BagItemClass extends FindOrCreate { })).doc record.count += item.count await record.save() - await ItemRecord.log(accountid, item.id, item.count, reason, more) results.push(record.toJson()) + setImmediate(function (){ + ItemRecord.log(accountid, item.id, item.count, reason, more) + .then(()=>{}).catch(err=>{ + error('error add item log', err) + }) + }) } return results } @@ -108,7 +113,12 @@ class BagItemClass extends FindOrCreate { const conditions = {accountid, itemid: item.id} const update = {$inc: {count: -item.count}} await BagItem.updateOne(conditions, update) - await ItemRecord.log(accountid, item.id, -item.count, reason, more) + setImmediate(function (){ + ItemRecord.log(accountid, item.id, -item.count, reason, more) + .then(()=>{}).catch(err=>{ + error('error add item log', err) + }) + }) } }