mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-07 13:22:31 +00:00
fix: instance logger tails cleaned up on exit
This commit is contained in:
parent
80b3da319a
commit
0799d1e11b
@ -1,5 +1,6 @@
|
||||
import { DEBUG, mkInstanceDataPath } from '$constants'
|
||||
import { LoggerService, createCleanupManager } from '$shared'
|
||||
import { asyncExitHook } from '$util'
|
||||
import * as fs from 'fs'
|
||||
import { Tail } from 'tail'
|
||||
import * as winston from 'winston'
|
||||
@ -103,8 +104,11 @@ export function InstanceLogger(instanceId: string, target: string) {
|
||||
}
|
||||
check()
|
||||
|
||||
const unsub = asyncExitHook(() => cm.shutdown())
|
||||
|
||||
return () => {
|
||||
cm.shutdown()
|
||||
unsub()
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user