Skip to content

Commit

Permalink
Add cron job to sync CiviCRM groups (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi authored Nov 10, 2023
1 parent f1d9588 commit baadf41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/workers/civicrm_sync_groups_worker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

require "rake"

Rails.application.load_tasks

class CivicrmSyncGroupsWorker
include Sidekiq::Worker

def perform(*_args)
Rake::Task["civicrm:sync:groups"].invoke
end
end
4 changes: 4 additions & 0 deletions config/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ metrics_job:
class: "MetricsGenerationWorker"
queue: metrics

civicrm_job:
cron: "30 2 * * *"
class: "CivicrmSyncGroupsWorker"
queue: default

0 comments on commit baadf41

Please sign in to comment.