Skip to content

Commit

Permalink
fix: failed pins cron (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw authored Jan 17, 2022
1 parent 06a99f5 commit eab0411
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/cron/src/bin/pins-failed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { fileURLToPath } from 'url'
import dotenv from 'dotenv'
import fetch from 'node-fetch'
import { checkFailedPinStatuses } from '../jobs/pins.js'
import { getDBClient, getCluster1, getCluster2 } from '../lib/utils.js'
import {
getDBClient,
getCluster1,
getCluster2,
getCluster3,
} from '../lib/utils.js'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
/** @ts-ignore */
Expand All @@ -18,9 +23,10 @@ async function main() {
const db = getDBClient(process.env)
const cluster1 = getCluster1(process.env)
const cluster2 = getCluster2(process.env)
const cluster3 = getCluster3(process.env)
const after = process.env.AFTER ? new Date(process.env.AFTER) : oneMonthAgo()

await checkFailedPinStatuses({ db, cluster1, cluster2, after })
await checkFailedPinStatuses({ db, cluster1, cluster2, cluster3, after })
}

dotenv.config({ path: path.join(__dirname, '../../../../.env') })
Expand Down

0 comments on commit eab0411

Please sign in to comment.