initial wcag-ada

This commit is contained in:
Boki 2025-06-28 11:11:34 -04:00
parent 042b8cb83a
commit d52cfe7de2
112 changed files with 9069 additions and 0 deletions

View 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();