Skip to content

Commit

Permalink
Refresh sitemap weekly
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerldixon committed Dec 10, 2023
1 parent 6e8f1c1 commit 75abded
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/jobs/sitemap_refresh_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class SitemapRefreshJob < ApplicationJob
def perform
Rake::Task["sitemap:refresh"].invoke
end
end
10 changes: 9 additions & 1 deletion config/initializers/good_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
preserve_job_records: true,
retry_on_unhandled_error: false,
execution_mode: :external,
poll_interval: 10
poll_interval: 10,
enable_cron: true,
cron: {
application_url_checker: {
cron: "@weekly",
class: "SitemapRefreshJob",
description: "Refreshes the sitemap weekly"
}
}
}
end

0 comments on commit 75abded

Please sign in to comment.