Update comments.
This commit is contained in:
parent
af20f3918f
commit
d2df17c7b9
@ -3,8 +3,8 @@ import { initRouters } from './lib/routers/index'
|
||||
import { ensureProsodyRunning, ensureProsodyNotRunning } from './lib/prosody/ctl'
|
||||
import decache from 'decache'
|
||||
|
||||
// FIXME: in Peertube <= 3.1.0, unregister don't have any parameter.
|
||||
// Using this global variable to fix this.
|
||||
// FIXME: Peertube unregister don't have any parameter.
|
||||
// Using this global variable to fix this, so we can use helpers to unregister.
|
||||
let OPTIONS: RegisterServerOptions | undefined
|
||||
|
||||
async function register (options: RegisterServerOptions): Promise<any> {
|
||||
@ -27,7 +27,8 @@ async function unregister (): Promise<any> {
|
||||
|
||||
const module = __filename
|
||||
OPTIONS?.peertubeHelpers.logger.info(`Unloading module ${module}...`)
|
||||
// In peertube <= 3.1.0 sub modules are not removed from require.cache
|
||||
// Peertube calls decache(plugin) on register, not unregister.
|
||||
// Will do here, to release memory.
|
||||
decache(module)
|
||||
OPTIONS?.peertubeHelpers.logger.info(`Successfully unloaded the module ${module}`)
|
||||
OPTIONS = undefined
|
||||
|
Loading…
x
Reference in New Issue
Block a user