From d2df17c7b9742847ec9190d629c7c181bba8175f Mon Sep 17 00:00:00 2001 From: John Livingston Date: Wed, 2 Jun 2021 12:48:24 +0200 Subject: [PATCH] Update comments. --- server/main.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/main.ts b/server/main.ts index 9e58c303..e2b7c00e 100644 --- a/server/main.ts +++ b/server/main.ts @@ -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 { @@ -27,7 +27,8 @@ async function unregister (): Promise { 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