diff --git a/api/src/unraid-api/nginx/nginx.service.ts b/api/src/unraid-api/nginx/nginx.service.ts index 09a1d89dc8..675ccbe662 100644 --- a/api/src/unraid-api/nginx/nginx.service.ts +++ b/api/src/unraid-api/nginx/nginx.service.ts @@ -10,6 +10,7 @@ export class NginxService { async reload() { try { await execa('/etc/rc.d/rc.nginx', ['reload']); + this.logger.log('Nginx reloaded'); return true; } catch (err: unknown) { this.logger.warn('Failed to reload Nginx with error: ', err); diff --git a/api/src/unraid-api/unraid-file-modifier/file-modification-effect.service.ts b/api/src/unraid-api/unraid-file-modifier/file-modification-effect.service.ts index 629317e6d2..b8154fb29a 100644 --- a/api/src/unraid-api/unraid-file-modifier/file-modification-effect.service.ts +++ b/api/src/unraid-api/unraid-file-modifier/file-modification-effect.service.ts @@ -1,14 +1,18 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; +import { ONE_SECOND_MS } from '@app/consts.js'; import { NginxService } from '@app/unraid-api/nginx/nginx.service.js'; import { ModificationEffect } from '@app/unraid-api/unraid-file-modifier/file-modification.js'; @Injectable() export class FileModificationEffectService { + private readonly logger = new Logger(FileModificationEffectService.name); constructor(private readonly nginxService: NginxService) {} async runEffect(effect: ModificationEffect): Promise { switch (effect) { case 'nginx:reload': + this.logger.log('Reloading Nginx in 10 seconds...'); + await new Promise((resolve) => setTimeout(resolve, 10 * ONE_SECOND_MS)); await this.nginxService.reload(); break; }