oneuptime/App/FeatureSet/Workers/Jobs/StatusPageCerts/StatusPageCerts.ts

24 lines
862 B
TypeScript
Raw Normal View History

import { EVERY_HOUR, EVERY_MINUTE } from 'Common/Utils/CronTime';
2022-11-27 20:10:55 +00:00
import RunCron from '../../Utils/Cron';
2023-09-11 10:29:36 +00:00
import { IsDevelopment } from 'CommonServer/EnvironmentConfig';
2022-11-27 20:10:55 +00:00
import StatusPageDomainService from 'CommonServer/Services/StatusPageDomainService';
2022-11-28 18:26:07 +00:00
import logger from 'CommonServer/Utils/Logger';
2023-03-14 19:55:22 +00:00
RunCron(
'StatusPageCerts:RenewCerts',
{ schedule: IsDevelopment ? EVERY_MINUTE : EVERY_HOUR, runOnStartup: true },
async () => {
logger.info('Renewing Certs...');
await StatusPageDomainService.renewCertsWhichAreExpiringSoon();
2023-03-14 19:55:22 +00:00
logger.info('Renew Completed...');
}
);
2022-12-08 16:23:21 +00:00
RunCron(
'StatusPageCerts:CheckSslProvisioningStatus',
2023-03-02 19:23:03 +00:00
{ schedule: IsDevelopment ? EVERY_MINUTE : EVERY_HOUR, runOnStartup: true },
2022-12-08 16:23:21 +00:00
async () => {
await StatusPageDomainService.updateSslProvisioningStatusForAllDomains();
2022-12-08 16:23:21 +00:00
}
);