egg 3.5.0 → 3.6.0

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.
Files changed (3) hide show
  1. package/index.d.ts +21 -1
  2. package/lib/egg.js +2 -0
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -2,11 +2,19 @@
2
2
  import accepts = require('accepts');
3
3
  import KoaApplication = require('koa');
4
4
  import KoaRouter = require('koa-router');
5
+ import { AsyncLocalStorage } from 'async_hooks';
5
6
  import { EventEmitter } from 'events'
6
7
  import { Readable } from 'stream';
7
8
  import { Socket } from 'net';
8
9
  import { IncomingMessage, ServerResponse } from 'http';
9
- import { EggLogger as Logger, EggLoggers, LoggerLevel as EggLoggerLevel, EggLoggersOptions, EggLoggerOptions, EggContextLogger } from 'egg-logger';
10
+ import {
11
+ EggLogger as Logger,
12
+ EggLoggers,
13
+ LoggerLevel as EggLoggerLevel,
14
+ EggLoggersOptions,
15
+ EggLoggerOptions,
16
+ EggContextLogger
17
+ } from 'egg-logger';
10
18
  import { HttpClient, RequestOptions2 as RequestOptions } from 'urllib';
11
19
  import {
12
20
  EggCoreBase,
@@ -683,6 +691,18 @@ declare module 'egg' {
683
691
  * @param {Function} scope - the first args is an anonymous ctx
684
692
  */
685
693
  runInBackground(scope: (ctx: Context) => void): void;
694
+
695
+ /**
696
+ * Get current execute ctx async local storage
697
+ * @returns {AsyncLocalStorage} localStorage - store current execute Context
698
+ */
699
+ get ctxStorage(): AsyncLocalStorage<Context>;
700
+
701
+ /**
702
+ * Get current execute ctx, maybe undefined
703
+ * @returns {Context} ctx - current execute Context
704
+ */
705
+ get currentConext(): Context;
686
706
  }
687
707
 
688
708
  export interface IApplicationLocals extends PlainObject { }
package/lib/egg.js CHANGED
@@ -446,6 +446,8 @@ class EggApplication extends EggCore {
446
446
  }
447
447
  this.coreLogger.error(`check run/${this.type}_timing_${process.pid}.json for more details.`);
448
448
  this.emit('startTimeout');
449
+ this.dumpConfig();
450
+ this.dumpTiming();
449
451
  }, this.config.workerStartTimeout);
450
452
  this.ready(() => clearTimeout(startTimeoutTimer));
451
453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "publishConfig": {
5
5
  "tag": "next"
6
6
  },
@@ -28,7 +28,7 @@
28
28
  "delegates": "^1.0.0",
29
29
  "egg-cluster": "^2.0.0",
30
30
  "egg-cookies": "^2.6.1",
31
- "egg-core": "^4.26.1",
31
+ "egg-core": "^4.29.0",
32
32
  "egg-development": "^2.7.0",
33
33
  "egg-errors": "^2.3.1",
34
34
  "egg-i18n": "^2.1.1",