good_job cron for periodic tasks

This commit is contained in:
Dylan Knutson
2025-01-27 18:41:05 +00:00
parent 9746cefa51
commit 172f47b649
3 changed files with 50 additions and 22 deletions

View File

@@ -37,27 +37,6 @@ task periodic_tasks: %i[environment set_logger_stdout] do
end
end
Thread.new do
loop do
Rake::Task["fa:browse_page_job"].execute
Rake::Task["fa:home_page_job"].execute
Rake::Task["e621:posts_index_job"].execute
puts "enqueue periodic jobs"
sleep 1.minute
end
end
Thread.new do
loop do
puts "enqueue inkbunny latest posts"
Domain::Inkbunny::Job::LatestPostsJob.set(
queue: "inkbunny",
priority: -20,
).perform_later({})
sleep 2.minutes
end
end
loop { sleep 10 }
end
@@ -85,6 +64,7 @@ task good_job: %i[environment set_ar_stdout set_logger_stdout] do
"GOOD_JOB_MAX_CACHE" => "10000",
"GOOD_JOB_QUEUE_SELECT_LIMIT" => "4096",
"GOOD_JOB_MAX_THREADS" => "4",
"GOOD_JOB_ENABLE_CRON" => "1",
"GOOD_JOB_QUEUES" =>
ENV["GOOD_JOB_QUEUES"] ||
%w[manual:4 fa_post,e621:2 *:6].reject(&:nil?).join(";"),