add features
This commit is contained in:
@@ -3,6 +3,7 @@ import environment from './config/environment';
|
||||
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';
|
||||
|
||||
const startServer = async (): Promise<void> => {
|
||||
try {
|
||||
@@ -20,6 +21,9 @@ const startServer = async (): Promise<void> => {
|
||||
// Start the GDPR IP anonymisation job
|
||||
startAuditCleanupJob();
|
||||
|
||||
// Start the notification generation job
|
||||
startNotificationJob();
|
||||
|
||||
// Start the server
|
||||
const server = app.listen(environment.port, () => {
|
||||
logger.info('Server started successfully', {
|
||||
@@ -35,6 +39,7 @@ const startServer = async (): Promise<void> => {
|
||||
|
||||
// Stop scheduled jobs first
|
||||
stopAuditCleanupJob();
|
||||
stopNotificationJob();
|
||||
|
||||
server.close(async () => {
|
||||
logger.info('HTTP server closed');
|
||||
|
||||
Reference in New Issue
Block a user