File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,9 +239,9 @@ export class EggCore extends KoaApplication {
239239 const singleton = new Singleton ( options ) ;
240240 const initPromise = singleton . init ( ) ;
241241 if ( initPromise ) {
242- this . beforeStart ( async ( ) => {
242+ this . lifecycle . registerBeforeStart ( async ( ) => {
243243 await initPromise ;
244- } ) ;
244+ } , ` ${ name } -singleton-init` ) ;
245245 }
246246 }
247247
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export class Singleton<T = any> {
108108 createInstance ( config : Record < string , any > , clientName : string ) {
109109 // async creator only support createInstanceAsync
110110 assert ( ! isAsyncFunction ( this . create ) ,
111- `[@eggjs/core/singleton] ${ this . name } only support synchronous creation, please use createInstanceAsync` ) ;
111+ `[@eggjs/core/singleton] ${ this . name } only support asynchronous creation, please use createInstanceAsync` ) ;
112112 // options.default will be merge in to options.clients[id]
113113 config = {
114114 ...this . options . default ,
You can’t perform that action at this time.
0 commit comments