added email verification
This commit is contained in:
@@ -1,39 +1,37 @@
|
||||
import { parentPort } from 'worker_threads';
|
||||
import { NetworkScanner } from '../helpers/network_scanner';
|
||||
import { parentPort } from 'worker_threads'
|
||||
import { NetworkScanner } from '../helpers/network_scanner'
|
||||
|
||||
// Extract data from environment variables
|
||||
const udpPort = parseInt(process.env.UDP_PORT || '0', 10);
|
||||
const tcpPort = parseInt(process.env.TCP_PORT || '0', 10);
|
||||
const okPage = process.env.OK_PAGE || '';
|
||||
const errorPage = process.env.ERROR_PAGE || '';
|
||||
const databaseResetPage = process.env.DATABASE_RESET_PAGE || '';
|
||||
const userConfigPath = process.env.USER_CONFIG_PATH || '';
|
||||
const applicationInfoPath = process.env.APPLICATION_INFO_PATH || '';
|
||||
const udpPort = parseInt(process.env.UDP_PORT || '0', 10)
|
||||
const tcpPort = parseInt(process.env.TCP_PORT || '0', 10)
|
||||
const okPage = process.env.OK_PAGE || ''
|
||||
const errorPage = process.env.ERROR_PAGE || ''
|
||||
const databaseResetPage = process.env.DATABASE_RESET_PAGE || ''
|
||||
const pathToDatabaseFile = process.env.DATABASE_FILE_PATH || ''
|
||||
|
||||
// Start the NetworkScanner instance
|
||||
const networkScanner = new NetworkScanner(
|
||||
applicationInfoPath,
|
||||
userConfigPath,
|
||||
udpPort,
|
||||
tcpPort,
|
||||
okPage,
|
||||
errorPage,
|
||||
databaseResetPage
|
||||
);
|
||||
pathToDatabaseFile,
|
||||
udpPort,
|
||||
tcpPort,
|
||||
okPage,
|
||||
errorPage,
|
||||
databaseResetPage,
|
||||
)
|
||||
|
||||
process.on('SIGTERM', async () => {
|
||||
console.log('Received SIGTERM. Cleaning up...');
|
||||
await cleanupAndExit();
|
||||
});
|
||||
console.log('Received SIGTERM. Cleaning up...')
|
||||
await cleanupAndExit()
|
||||
})
|
||||
|
||||
process.on('SIGINT', async () => {
|
||||
console.log('Received SIGINT. Cleaning up...');
|
||||
await cleanupAndExit();
|
||||
});
|
||||
console.log('Received SIGINT. Cleaning up...')
|
||||
await cleanupAndExit()
|
||||
})
|
||||
|
||||
async function cleanupAndExit() {
|
||||
networkScanner.stopAllIntervals();
|
||||
networkScanner.stopAllIntervals()
|
||||
|
||||
console.log('Cleanup complete. Exiting.');
|
||||
process.exit(0); // Exit with code 0 to indicate a clean exit
|
||||
console.log('Cleanup complete. Exiting.')
|
||||
process.exit(0) // Exit with code 0 to indicate a clean exit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user