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

52 lines
1.4 KiB
TypeScript
Raw Normal View History

import RunCron from "../../Utils/Cron";
import { EVERY_FIFTEEN_MINUTE } from "Common/Utils/CronTime";
import { IsDevelopment } from "CommonServer/EnvironmentConfig";
import StatusPageDomainService from "CommonServer/Services/StatusPageDomainService";
import logger from "CommonServer/Utils/Logger";
2022-11-28 18:26:07 +00:00
2023-03-14 19:55:22 +00:00
RunCron(
"StatusPageCerts:RenewCerts",
{
schedule: IsDevelopment ? EVERY_FIFTEEN_MINUTE : EVERY_FIFTEEN_MINUTE,
runOnStartup: true,
},
async () => {
logger.debug("Renewing Certs...");
await StatusPageDomainService.renewCertsWhichAreExpiringSoon();
logger.debug("Renew Completed...");
},
2023-03-14 19:55:22 +00:00
);
2022-12-08 16:23:21 +00:00
RunCron(
"StatusPageCerts:CheckSslProvisioningStatus",
{
schedule: IsDevelopment ? EVERY_FIFTEEN_MINUTE : EVERY_FIFTEEN_MINUTE,
runOnStartup: true,
},
async () => {
await StatusPageDomainService.updateSslProvisioningStatusForAllDomains();
},
2022-12-08 16:23:21 +00:00
);
2024-04-30 18:12:03 +00:00
RunCron(
"StatusPageCerts:OrderSSL",
{
schedule: IsDevelopment ? EVERY_FIFTEEN_MINUTE : EVERY_FIFTEEN_MINUTE,
runOnStartup: true,
},
async () => {
await StatusPageDomainService.orderSSLForDomainsWhichAreNotOrderedYet();
},
2024-04-30 18:12:03 +00:00
);
RunCron(
"StatusPageCerts:VerifyCnameWhoseCnameisNotVerified",
{
schedule: IsDevelopment ? EVERY_FIFTEEN_MINUTE : EVERY_FIFTEEN_MINUTE,
runOnStartup: true,
},
async () => {
await StatusPageDomainService.verifyCnameWhoseCnameisNotVerified();
},
);