Skip to content

Commit

Permalink
fix(cron): run monitoring every 5 mins
Browse files Browse the repository at this point in the history
  • Loading branch information
kishore03109 committed Jun 27, 2024
1 parent cdd5fe3 commit e708663
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const REDIRECTION_SERVER_IPS = [
]
export const ALLOWED_DNS_ERROR_CODES = ["ENOTFOUND", "ENODATA"]

export const BUILT_WITH_ISOMER_LOGO = `<p class="footer-credits"><a href="https://www.isomer.gov.sg/" target="_blank" rel="noreferrer">Created with <img src="/assets/img/isomer_logo.svg" alt="Isomer Logo"></a>`
export const BUILT_WITH_ISOMER_LOGO = `<p class="footer-credits"><a href="https://www.isomer.gov.sg/"`
export const DNS_INDIRECTION_DOMAIN = "hostedon.isomer.gov.sg"
export const DNS_KEYCDN_SUFFIX = "kxcdn.com"
export const DNS_CNAME_SUFFIXES = ["cloudfront.net", DNS_KEYCDN_SUFFIX]
Expand Down
2 changes: 1 addition & 1 deletion src/monitoring/MonitoringService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class MonitoringService {
autoBind(this)
const jobName = "dnsMonitoring"

const FIVE_MINUTE_CRON = "5 * * * *"
const FIVE_MINUTE_CRON = "*/5 * * * *"

const jobData = {
name: "monitoring sites",
Expand Down
5 changes: 3 additions & 2 deletions src/utils/dns-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

export function checkCname(domain: string) {
return ResultAsync.fromPromise(dns.resolveCname(domain), () => {
logger.error({
logger.info({
message: "Error resolving CNAME",
meta: { domain, method: "checkCname" },
})
Expand All @@ -38,7 +38,7 @@ export function checkCname(domain: string) {

export function checkA(domain: string) {
return ResultAsync.fromPromise(dns.resolve4(domain), () => {
logger.error({
logger.info({
message: "Error resolving A record",
meta: { domain, method: "checkA" },
})
Expand Down Expand Up @@ -180,6 +180,7 @@ export default function getDnsCheckerMessage(
}

export function dnsMonitor(domain: string): ResultAsync<string, string> {
console.log("dnsMonitor", domain)
if (!domain) {
return okAsync("Empty domain provided")
}
Expand Down

0 comments on commit e708663

Please sign in to comment.