2024-01-29 08:45:51 +00:00
|
|
|
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...');
|
2024-04-28 12:09:23 +00:00
|
|
|
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 () => {
|
2024-04-28 12:09:23 +00:00
|
|
|
await StatusPageDomainService.updateSslProvisioningStatusForAllDomains();
|
2022-12-08 16:23:21 +00:00
|
|
|
}
|
|
|
|
);
|