Refactoring the debug mode code, and adding some options.

This commit is contained in:
John Livingston
2023-05-23 12:39:05 +02:00
parent b525c203da
commit 8fe48a068f
8 changed files with 157 additions and 63 deletions

View File

@ -5,6 +5,7 @@ import { initCustomFields } from './lib/custom-fields'
import { initRouters } from './lib/routers/index'
import { initFederation } from './lib/federation/init'
import { prepareProsody, ensureProsodyRunning, ensureProsodyNotRunning } from './lib/prosody/ctl'
import { unloadDebugMode } from './lib/debug'
import decache from 'decache'
// FIXME: Peertube unregister don't have any parameter.
@ -43,6 +44,8 @@ async function unregister (): Promise<any> {
}
}
unloadDebugMode()
const module = __filename
OPTIONS?.peertubeHelpers.logger.info(`Unloading module ${module}...`)
// Peertube calls decache(plugin) on register, not unregister.