File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ namespace Event {
2525
2626let child : ChildProcess
2727
28- process . env . KOISHI_SHARED = '{}'
28+ process . env . KOISHI_SHARED = JSON . stringify ( {
29+ startTime : Date . now ( ) ,
30+ } )
2931
3032function toArg ( key : string ) {
3133 return key . length === 1 ? `-${ key } ` : `--${ hyphenate ( key ) } `
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ declare module '@koishijs/core' {
2222
2323 interface EnvData {
2424 message ?: StartMessage
25+ startTime ?: number
2526 }
2627}
2728
@@ -110,7 +111,10 @@ export abstract class Loader {
110111
111112 // process
112113 public baseDir = process . cwd ( )
113- public envData = JSON . parse ( process . env . KOISHI_SHARED || '{}' )
114+ public envData = process . env . KOISHI_SHARED
115+ ? JSON . parse ( process . env . KOISHI_SHARED )
116+ : { startTime : Date . now ( ) }
117+
114118 public params = {
115119 env : process . env ,
116120 }
@@ -139,7 +143,6 @@ export abstract class Loader {
139143 this . prolog = this . prolog . slice ( - 1000 )
140144 } ,
141145 } )
142- new Logger ( 'app' ) . info ( '%C' , `Koishi/${ version } ` )
143146 }
144147
145148 async init ( filename ?: string ) {
@@ -315,6 +318,7 @@ export abstract class Loader {
315318 }
316319
317320 async createApp ( ) {
321+ new Logger ( 'app' ) . info ( '%C' , `Koishi/${ version } ` )
318322 const app = this . app = new Context ( this . interpolate ( this . config ) )
319323 app . loader = this
320324 app . baseDir = this . baseDir
You can’t perform that action at this time.
0 commit comments