Make email service initialization asynchronous
All checks were successful
Build And Push Image / docker (push) Successful in 3m10s

Convert getEmailService() to async function and update all callers to use await.
Replace synchronous require() with dynamic import() for admin-config module.
Add SMTP config loading to admin configuration dialog.
This commit is contained in:
2025-08-09 15:50:54 +02:00
parent 97a0b5eea6
commit dcb7840825
6 changed files with 12 additions and 6 deletions

View File

@@ -334,8 +334,8 @@ let emailServiceInstance: EmailService | null = null;
/**
* Get or create EmailService instance with current SMTP config
*/
export function getEmailService(): EmailService {
const { getSMTPConfig } = require('./admin-config');
export async function getEmailService(): Promise<EmailService> {
const { getSMTPConfig } = await import('./admin-config');
const config = getSMTPConfig();
if (!emailServiceInstance) {