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 { DEBUG, mkInstanceDataPath } from '$constants'
|
||||||
import { LoggerService, createCleanupManager } from '$shared'
|
import { LoggerService, createCleanupManager } from '$shared'
|
||||||
|
import { asyncExitHook } from '$util'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import { Tail } from 'tail'
|
import { Tail } from 'tail'
|
||||||
import * as winston from 'winston'
|
import * as winston from 'winston'
|
||||||
@ -103,8 +104,11 @@ export function InstanceLogger(instanceId: string, target: string) {
|
|||||||
}
|
}
|
||||||
check()
|
check()
|
||||||
|
|
||||||
|
const unsub = asyncExitHook(() => cm.shutdown())
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
cm.shutdown()
|
cm.shutdown()
|
||||||
|
unsub()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user