static import and error catching
This commit is contained in:
parent
e6793c9655
commit
87d267a1c3
1 changed files with 5 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ import { repositoriesService } from "../repositories/repositories.service";
|
||||||
import { notificationsService } from "../notifications/notifications.service";
|
import { notificationsService } from "../notifications/notifications.service";
|
||||||
import { VolumeAutoRemountJob } from "~/server/jobs/auto-remount";
|
import { VolumeAutoRemountJob } from "~/server/jobs/auto-remount";
|
||||||
import { cache } from "~/server/utils/cache";
|
import { cache } from "~/server/utils/cache";
|
||||||
|
import { initAuth } from "~/lib/auth";
|
||||||
|
|
||||||
const ensureLatestConfigurationSchema = async () => {
|
const ensureLatestConfigurationSchema = async () => {
|
||||||
const volumes = await db.query.volumesTable.findMany({});
|
const volumes = await db.query.volumesTable.findMany({});
|
||||||
|
|
@ -50,8 +51,10 @@ export const startup = async () => {
|
||||||
logger.error(`Error ensuring restic passfile exists: ${err.message}`);
|
logger.error(`Error ensuring restic passfile exists: ${err.message}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
const { initAuth } = await import("~/lib/auth");
|
await initAuth().catch((err) => {
|
||||||
await initAuth();
|
logger.error(`Error initializing auth: ${err.message}`);
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
|
||||||
await ensureLatestConfigurationSchema();
|
await ensureLatestConfigurationSchema();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue