fix: Fixes eslint issues.
This commit is contained in:
parent
436811a0e3
commit
3806ce92cb
3 changed files with 25 additions and 7 deletions
|
@ -93,8 +93,17 @@ const logWrapper = (arg: string) => fastify.log.info(arg);
|
|||
const errorWrapper = (arg: string) => fastify.log.error(arg);
|
||||
|
||||
for (const backend of createdBackends) {
|
||||
fastify.log.info(`Running init steps for ID '${backend.id}' (${backend.name})`);
|
||||
const init = await backendInit(backend, backends, prisma, logWrapper, errorWrapper);
|
||||
fastify.log.info(
|
||||
`Running init steps for ID '${backend.id}' (${backend.name})`,
|
||||
);
|
||||
|
||||
const init = await backendInit(
|
||||
backend,
|
||||
backends,
|
||||
prisma,
|
||||
logWrapper,
|
||||
errorWrapper,
|
||||
);
|
||||
|
||||
if (init) fastify.log.info("Init successful.");
|
||||
}
|
||||
|
|
|
@ -18,10 +18,13 @@ export async function backendInit(
|
|||
backends: Record<number, BackendBaseClass>,
|
||||
prisma: PrismaClient,
|
||||
logger?: (arg: string) => void,
|
||||
errorOut?: (arg: string) => void
|
||||
errorOut?: (arg: string) => void,
|
||||
): Promise<boolean> {
|
||||
const log = (...args: any[]) => logger ? logger(format(...args)) : console.log(...args);
|
||||
const error = (...args: any[]) => errorOut ? errorOut(format(...args)) : log(...args);
|
||||
const log = (...args: string[]) =>
|
||||
logger ? logger(format(...args)) : console.log(...args);
|
||||
|
||||
const error = (...args: string[]) =>
|
||||
errorOut ? errorOut(format(...args)) : log(...args);
|
||||
|
||||
const ourProvider = backendProviders[backend.backend];
|
||||
|
||||
|
|
|
@ -83,7 +83,13 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
});
|
||||
|
||||
const init = await backendInit(backend, backends, prisma, logWrapper, errorWrapper);
|
||||
const init = await backendInit(
|
||||
backend,
|
||||
backends,
|
||||
prisma,
|
||||
logWrapper,
|
||||
errorWrapper,
|
||||
);
|
||||
|
||||
if (!init) {
|
||||
// TODO: better error code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue