diff --git a/src/back/jobs/BadgeAirdrop.ts b/src/back/jobs/BadgeAirdrop.ts index b3bc0011d..28bf1fece 100644 --- a/src/back/jobs/BadgeAirdrop.ts +++ b/src/back/jobs/BadgeAirdrop.ts @@ -7,10 +7,6 @@ import logger from '../../utils/logger' import AirdropJobModel, { AirdropJobAttributes } from '../models/AirdropJob' import { AirdropJobStatus } from '../types/AirdropJob' -export async function runAirdropJobs() { - await Promise.all([runQueuedAirdropJobs(), giveAndRevokeLandOwnerBadges()]) -} - export async function runQueuedAirdropJobs() { const pendingJobs = await AirdropJobModel.getPending() if (pendingJobs.length === 0) { diff --git a/src/server.ts b/src/server.ts index 0c0c07c22..36d884009 100644 --- a/src/server.ts +++ b/src/server.ts @@ -15,7 +15,7 @@ import { register } from 'prom-client' import swaggerUi from 'swagger-ui-express' import YAML from 'yaml' -import { giveTopVoterBadges, runAirdropJobs } from './back/jobs/BadgeAirdrop' +import { giveAndRevokeLandOwnerBadges, giveTopVoterBadges, runQueuedAirdropJobs } from './back/jobs/BadgeAirdrop' import { pingSnapshot } from './back/jobs/PingSnapshot' import { withLock } from './back/jobs/jobLocks' import airdrops from './back/routes/airdrop' @@ -50,10 +50,11 @@ jobs.cron('@eachMinute', finishProposal) jobs.cron('@eachMinute', activateProposals) jobs.cron('@each5Minute', withLock('publishBids', publishBids)) jobs.cron('@each10Second', pingSnapshot) -jobs.cron('@daily', updateGovernanceBudgets) -jobs.cron('@daily', runAirdropJobs) -jobs.cron('@monthly', giveTopVoterBadges) -jobs.cron('@daily', EventsService.deleteOldEvents) +jobs.cron('30 0 * * *', updateGovernanceBudgets) // Runs at 00:30 daily +jobs.cron('0 1 * * *', EventsService.deleteOldEvents) // Runs at 01:00 daily +jobs.cron('30 1 * * *', runQueuedAirdropJobs) // Runs at 01:30 daily +jobs.cron('0 2 * * *', giveAndRevokeLandOwnerBadges) // Runs at 02:00 daily +jobs.cron('30 2 1 * *', giveTopVoterBadges) // Runs at 02:30 on the first day of the month const file = readFileSync('static/api.yaml', 'utf8') const swaggerDocument = YAML.parse(file)