From 68efe8a3cc4451351440d6198fe41c435cf4d71d Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Thu, 18 Dec 2025 17:35:37 +0100 Subject: [PATCH] refactor: await config updates to avoid race condition on later mount --- app/server/modules/lifecycle/startup.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/server/modules/lifecycle/startup.ts b/app/server/modules/lifecycle/startup.ts index 9c9de761..23ec81fb 100644 --- a/app/server/modules/lifecycle/startup.ts +++ b/app/server/modules/lifecycle/startup.ts @@ -17,7 +17,7 @@ const ensureLatestConfigurationSchema = async () => { const volumes = await db.query.volumesTable.findMany({}); for (const volume of volumes) { - volumeService.updateVolume(volume.name, volume).catch((err) => { + await volumeService.updateVolume(volume.name, volume).catch((err) => { logger.error(`Failed to update volume ${volume.name}: ${err}`); }); } @@ -25,7 +25,7 @@ const ensureLatestConfigurationSchema = async () => { const repositories = await db.query.repositoriesTable.findMany({}); for (const repo of repositories) { - repositoriesService.updateRepository(repo.name, {}).catch((err) => { + await repositoriesService.updateRepository(repo.name, {}).catch((err) => { logger.error(`Failed to update repository ${repo.name}: ${err}`); }); } @@ -33,7 +33,7 @@ const ensureLatestConfigurationSchema = async () => { const notifications = await db.query.notificationDestinationsTable.findMany({}); for (const notification of notifications) { - notificationsService.updateDestination(notification.id, notification).catch((err) => { + await notificationsService.updateDestination(notification.id, notification).catch((err) => { logger.error(`Failed to update notification destination ${notification.id}: ${err}`); }); }