new features
This commit is contained in:
@@ -4,6 +4,7 @@ import logger from './utils/logger';
|
||||
import { testConnection, closePool, runMigrations } from './config/database';
|
||||
import { startAuditCleanupJob, stopAuditCleanupJob } from './jobs/audit-cleanup.job';
|
||||
import { startNotificationJob, stopNotificationJob } from './jobs/notification-generation.job';
|
||||
import { startReminderJob, stopReminderJob } from './jobs/reminder.job';
|
||||
import { permissionService } from './services/permission.service';
|
||||
|
||||
const startServer = async (): Promise<void> => {
|
||||
@@ -28,6 +29,9 @@ const startServer = async (): Promise<void> => {
|
||||
// Start the notification generation job
|
||||
startNotificationJob();
|
||||
|
||||
// Start the order reminder job
|
||||
startReminderJob();
|
||||
|
||||
// Start the server
|
||||
const server = app.listen(environment.port, () => {
|
||||
logger.info('Server started successfully', {
|
||||
@@ -51,6 +55,7 @@ const startServer = async (): Promise<void> => {
|
||||
// Stop scheduled jobs first
|
||||
stopAuditCleanupJob();
|
||||
stopNotificationJob();
|
||||
stopReminderJob();
|
||||
|
||||
server.close(async () => {
|
||||
logger.info('HTTP server closed');
|
||||
|
||||
Reference in New Issue
Block a user