network chunk v18
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
import { parentPort, workerData } from 'worker_threads';
|
||||
import { parentPort } from 'worker_threads';
|
||||
import { NetworkScanner } from '../helpers/network_scanner';
|
||||
|
||||
// Define the structure of workerData
|
||||
interface WorkerData {
|
||||
udpPort: number;
|
||||
tcpPort: number;
|
||||
okPage: string;
|
||||
errorPage: string;
|
||||
databaseResetPage: string;
|
||||
userConfigPath: string;
|
||||
applicationInfoPath: string;
|
||||
}
|
||||
|
||||
// Extract the data passed to the worker
|
||||
const { udpPort, tcpPort, okPage, errorPage, databaseResetPage, userConfigPath, applicationInfoPath }: WorkerData = workerData;
|
||||
// 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 || '';
|
||||
|
||||
// Start the NetworkScanner instance
|
||||
const networkScanner = new NetworkScanner(applicationInfoPath, userConfigPath, udpPort, tcpPort, okPage, errorPage, databaseResetPage);
|
||||
const networkScanner = new NetworkScanner(
|
||||
applicationInfoPath,
|
||||
userConfigPath,
|
||||
udpPort,
|
||||
tcpPort,
|
||||
okPage,
|
||||
errorPage,
|
||||
databaseResetPage
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user