split services to api, worker, and shared
This commit is contained in:
1 parent
f59a7c3113
commit
71d3e789ff
10 files changed
+375
-353
No files matched your search
@@ -1,8 +1,14 @@
|
||||
import { InitializedServices } from "./config/services.js";
|
||||
import { IDb } from "@/db/db.interface.js";
|
||||
import { logger } from "./utils/logger.js";
|
||||
import type { Server } from "http";
|
||||
import { Mongoose } from "mongoose";
|
||||
import { IJobScheduler } from "@/worker/worker.interface.js";
|
||||
|
||||
export const initShutdownListener = (server: Server | null, services: InitializedServices) => {
|
||||
type ShutdownTargets = {
|
||||
worker: IJobScheduler;
|
||||
db: IDb<Mongoose>;
|
||||
};
|
||||
export const initShutdownListener = (server: Server | null, services: ShutdownTargets) => {
|
||||
const SERVICE_NAME = "Server";
|
||||
|
||||
let isShuttingDown = false;
|
||||
|
||||
Reference in new issue
Block a user