Fix hanging IORedis connections; add extollo.wontstop debugging helper

This commit is contained in:
2022-03-29 02:30:48 -05:00
parent 8f08b94f74
commit cdecb7e628
5 changed files with 43 additions and 11 deletions

View File

@@ -8,13 +8,14 @@ import {
StandardLogger,
universalPath,
UniversalPath,
FileLogger,
ifDebugging,
} from '../util'
import {Logging} from '../service/Logging'
import {RunLevelErrorHandler} from './RunLevelErrorHandler'
import {Unit, UnitStatus} from './Unit'
import * as dotenv from 'dotenv'
import {CacheFactory} from '../support/cache/CacheFactory'
import {FileLogger} from '../util/logging/FileLogger'
/**
* Helper function that resolves and infers environment variable values.
@@ -260,6 +261,13 @@ export class Application extends Container {
async run(): Promise<void> {
try {
await this.up()
ifDebugging('extollo.wontstop', () => {
setTimeout(() => {
import('wtfnode').then(wtf => wtf.dump())
}, 1000)
})
await this.down()
} catch (e: unknown) {
if ( e instanceof Error ) {