Skip to content

Commit

Permalink
add IMPORT_PROJECT_CRON_SCHEDULE
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadPCh committed May 21, 2024
1 parent 230852a commit 7ca39db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ export const PROJECT_VERIFY_SCHEMA = assertNotNull(
).toLocaleLowerCase();

export const START_BLOCK = parseInt(process.env.START_BLOCK || "5815457");

export const IMPORT_PROJECT_CRON_SCHEDULE =
process.env.IMPORT_PROJECT_CRON_SCHEDULE || "0 0 * * *"; // UTC
4 changes: 2 additions & 2 deletions src/features/import-projects/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cron from "node-cron";
import { fetchAndProcessGivethProjects } from "./giveth/helpers";
import { CRON_SCHEDULE } from "./config";
import { IMPORT_PROJECT_CRON_SCHEDULE } from "../../constants";

export const task = async () => {
console.log("Importing Projects", new Date());
Expand All @@ -10,7 +10,7 @@ export const task = async () => {
export const importProjects = async () => {
try {
console.log("Importing Projects has been scheduled.");
cron.schedule(CRON_SCHEDULE, task, {
cron.schedule(IMPORT_PROJECT_CRON_SCHEDULE, task, {
scheduled: true,
timezone: "UTC",
});
Expand Down

0 comments on commit 7ca39db

Please sign in to comment.