Skip to content

Commit

Permalink
Add DB update timer
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Dec 25, 2023
1 parent c91bdd6 commit 7a87132
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/global/utils/timer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable max-len */
/* eslint-disable max-len */
import {
ActivityType,
CategoryChannel,
Expand All @@ -15,6 +14,7 @@ import Parser from 'rss-parser';
import { DateTime } from 'luxon';
import axios from 'axios'; // eslint-disable-line
import { stripIndents } from 'common-tags';
import updateDb from './updateDb';
import {
reminderGet,
reminderDel,
Expand Down Expand Up @@ -1080,7 +1080,7 @@ async function runTimer() {
const seconds30 = 1000 * 30;
const seconds60 = 1000 * 60;
const minutes5 = 1000 * 60 * 5;
// const hours24 = 1000 * 60 * 60 * 24;
const hours24 = 1000 * 60 * 60 * 24;

const timers = [
{ callback: checkReminders, interval: env.NODE_ENV === 'production' ? seconds10 : seconds5 },
Expand All @@ -1093,6 +1093,7 @@ async function runTimer() {
{ callback: checkStats, interval: env.NODE_ENV === 'production' ? minutes5 : seconds5 },
{ callback: checkMoodle, interval: env.NODE_ENV === 'production' ? seconds60 : seconds5 },
// { callback: checkLpm, interval: env.NODE_ENV === 'production' ? seconds10 : seconds5 },
{ callback: updateDb, interval: env.NODE_ENV === 'production' ? hours24 : seconds5 },
];

timers.forEach(timer => {
Expand Down

0 comments on commit 7a87132

Please sign in to comment.