egg-core
Advanced tools
Comparing version 5.3.1 to 5.4.0
const assert = require('assert'); | ||
const { AsyncLocalStorage } = require('async_hooks'); | ||
const fs = require('fs'); | ||
@@ -18,2 +19,3 @@ const KoaApplication = require('koa'); | ||
const CLOSE_PROMISE = Symbol('EggCore#closePromise'); | ||
const EGG_CTX_STORAGE = Symbol.for('egg#ctxStorage'); | ||
@@ -39,5 +41,9 @@ class EggCore extends KoaApplication { | ||
// enable asyncLocalStorage by default | ||
// https://github.com/koajs/koa/pull/1721 | ||
super({ asyncLocalStorage: true }); | ||
// disable koa als and use egg logic | ||
super({ asyncLocalStorage: false }); | ||
// can access the AsyncLocalStorage instance in global | ||
if (!global[EGG_CTX_STORAGE]) { | ||
global[EGG_CTX_STORAGE] = new AsyncLocalStorage(); | ||
} | ||
this.ctxStorage = global[EGG_CTX_STORAGE]; | ||
@@ -44,0 +50,0 @@ this.timing = new Timing(); |
{ | ||
"name": "egg-core", | ||
"version": "5.3.1", | ||
"version": "5.4.0", | ||
"publishConfig": { | ||
"tag": "latest-5" | ||
}, | ||
"description": "A core Pluggable framework based on koa", | ||
@@ -5,0 +8,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143839
25
3053
25