@cero-base/core 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/database/index.js +4 -1
package/package.json
CHANGED
package/src/database/index.js
CHANGED
|
@@ -762,12 +762,15 @@ export class Database extends ReadyResource {
|
|
|
762
762
|
/** @private */
|
|
763
763
|
_inHook(fn) {
|
|
764
764
|
return async (ctx) => {
|
|
765
|
+
// only the hook's own synchronous run is inside it: other work interleaves at its awaits
|
|
765
766
|
this._hooking++
|
|
767
|
+
let result
|
|
766
768
|
try {
|
|
767
|
-
|
|
769
|
+
result = fn(ctx)
|
|
768
770
|
} finally {
|
|
769
771
|
this._hooking--
|
|
770
772
|
}
|
|
773
|
+
return await result
|
|
771
774
|
}
|
|
772
775
|
}
|
|
773
776
|
|