Skip to content

Commit

Permalink
Merge pull request #1905 from Giveth/feat/check_periodically_endaoment
Browse files Browse the repository at this point in the history
update bootstrap.js adding check endaoment
  • Loading branch information
kkatusic authored Jan 13, 2025
2 parents 9d61941 + e9ea066 commit e8a7de5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/server/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ import { runCheckPendingUserModelScoreCronjob } from '../services/cronJobs/syncU
import { isTestEnv } from '../utils/utils';
import { refreshProjectEstimatedMatchingView } from '../services/projectViewsService';
import { runSyncEstimatedClusterMatchingCronjob } from '../services/cronJobs/syncEstimatedClusterMatchingJob';
import { runCheckAndUpdateEndaomentProject } from '../services/cronJobs/checkAndUpdateEndaomentProject';
import { runGenerateSitemapOnFrontend } from '../services/cronJobs/generateSitemapOnFrontend';

Resource.validate = validate;

Expand Down Expand Up @@ -362,6 +364,7 @@ export async function bootstrap() {
runCheckPendingRecurringDonationsCronJob();
runNotifyMissingDonationsCronJob();
runCheckPendingProjectListingCronJob();
runCheckAndUpdateEndaomentProject();

if (process.env.ENABLE_CLUSTER_MATCHING === 'true') {
runSyncEstimatedClusterMatchingCronjob();
Expand All @@ -376,6 +379,10 @@ export async function bootstrap() {
runCheckPendingUserModelScoreCronjob();
}

if (process.env.SITEMAP_CRON_SECRET !== '') {
runGenerateSitemapOnFrontend();
}

// If we need to deactivate the process use the env var NO MORE
// if (process.env.GIVING_BLOCKS_SERVICE_ACTIVE === 'true') {
// runGivingBlocksProjectSynchronization();
Expand Down
5 changes: 4 additions & 1 deletion src/services/cronJobs/generateSitemapOnFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
*/
import { schedule } from 'node-cron';
import axios from 'axios';
import config from '../../config';
import { logger } from '../../utils/logger';

const cronJobTime = '0 0 * * 0'; // Every Sunday at 00:00
// Every Sunday at 00:00
const cronJobTime =
(config.get('GENERATE_SITEMAP_CRONJOB_EXPRESSION') as string) || '0 0 * * 0';

export const runGenerateSitemapOnFrontend = () => {
logger.debug(
Expand Down

0 comments on commit e8a7de5

Please sign in to comment.