Phase9
This commit is contained in:
10
apps/worker/src/handlers/dns-sync.ts
Normal file
10
apps/worker/src/handlers/dns-sync.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { pushPendingDnsRecords } from '@hexahost/dns';
|
||||
|
||||
import { logger } from '../logger';
|
||||
|
||||
export async function processDnsSyncTick(): Promise<void> {
|
||||
const synced = await pushPendingDnsRecords(25);
|
||||
if (synced > 0) {
|
||||
logger.info({ synced }, 'DNS records synchronized');
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { Job, Worker, type ConnectionOptions } from 'bullmq';
|
||||
import { validateConfig } from '@hexahost/config';
|
||||
import { prisma } from '@hexahost/database';
|
||||
|
||||
import { processDnsSyncTick } from './handlers/dns-sync';
|
||||
import { processIdleShutdownTick, processUsageMeteringTick } from './handlers/idle-billing';
|
||||
import { processNodeHealthTick } from './handlers/node-health';
|
||||
import { processNotificationJob } from './handlers/notifications';
|
||||
@@ -106,6 +107,9 @@ async function bootstrap(): Promise<void> {
|
||||
void processUsageMeteringTick().catch((error: Error) => {
|
||||
logger.error({ err: error }, 'Usage metering tick failed');
|
||||
});
|
||||
void processDnsSyncTick().catch((error: Error) => {
|
||||
logger.error({ err: error }, 'DNS sync tick failed');
|
||||
});
|
||||
}, 60_000);
|
||||
|
||||
const shutdown = async (signal: string): Promise<void> => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user