Improve Self host setup (#30)
* Add self host setup * Improve blunders * Move to bull mq * More changes * Add example code for sending test emails
This commit is contained in:
19
apps/web/src/instrumentation.ts
Normal file
19
apps/web/src/instrumentation.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
let initialized = false;
|
||||
|
||||
/**
|
||||
* Add things here to be executed during server startup.
|
||||
*
|
||||
* more details here: https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation
|
||||
*/
|
||||
export async function register() {
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
if (process.env.NEXT_RUNTIME === "nodejs" && !initialized) {
|
||||
console.log("Registering instrumentation");
|
||||
const { EmailQueueService } = await import(
|
||||
"~/server/service/email-queue-service"
|
||||
);
|
||||
|
||||
await EmailQueueService.init();
|
||||
initialized = true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user