Skip to content

Commit

Permalink
fix: fix influx cron
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Nov 12, 2023
1 parent 4172292 commit c610bd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/influx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export const client = process.env.INFLUX_URL ? new InfluxDB({ url: process.env.I

export const cron = new CronJob('*/5 * * * *', collect, null, false, 'America/New_York');

async function collect(timestamp = new Date()) {
async function collect() {
if (!process.env.INFLUX_URL || !process.env.INFLUX_TOKEN) return;
if (!timestamp) timestamp = cron.lastDate();
const timestamp = cron.lastDate();

// Get postgres counts
const dbUserCount = await prisma.user.count();
Expand Down

0 comments on commit c610bd7

Please sign in to comment.