initial wcag-ada
This commit is contained in:
parent
042b8cb83a
commit
d52cfe7de2
112 changed files with 9069 additions and 0 deletions
47
apps/wcag-ada/worker/src/index.ts
Normal file
47
apps/wcag-ada/worker/src/index.ts
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import { initializeWcagConfig, getWorkerConfig } from '@wcag-ada/config';
|
||||
import { logger } from './utils/logger';
|
||||
import { ScanWorker } from './workers/scan-worker';
|
||||
import { SchedulerService } from './services/scheduler';
|
||||
import { HealthService } from './services/health';
|
||||
import { gracefulShutdown } from './utils/shutdown';
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
// Initialize configuration
|
||||
const config = initializeWcagConfig('worker');
|
||||
const workerConfig = getWorkerConfig();
|
||||
|
||||
logger.info('Starting WCAG-ADA Worker Service', {
|
||||
environment: config.environment,
|
||||
concurrency: workerConfig.concurrency,
|
||||
queue: workerConfig.queueName,
|
||||
});
|
||||
|
||||
// Initialize services
|
||||
const scanWorker = new ScanWorker();
|
||||
const scheduler = new SchedulerService();
|
||||
const health = new HealthService();
|
||||
|
||||
// Start services
|
||||
await scanWorker.start();
|
||||
logger.info('Scan worker started');
|
||||
|
||||
if (workerConfig.scheduler.enabled) {
|
||||
await scheduler.start();
|
||||
logger.info('Scheduler service started');
|
||||
}
|
||||
|
||||
await health.start();
|
||||
logger.info('Health service started');
|
||||
|
||||
// Setup graceful shutdown
|
||||
gracefulShutdown([scanWorker, scheduler, health]);
|
||||
|
||||
logger.info('WCAG-ADA Worker Service is running');
|
||||
} catch (error) {
|
||||
logger.error('Failed to start worker service', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue