Where is the crontab expression?

I don't see it.
10 Replies
Percy
Percyβ€’11mo ago
Project ID: 8696ee9c-3668-496c-a647-619282236f46
𓆩♑π“†ͺ
8696ee9c-3668-496c-a647-619282236f46
Brody
Brodyβ€’11mo ago
in the service settings
𓆩♑π“†ͺ
I dont understand how it works I need to run this this task every day
# lib/tasks/scheduler.rake
namespace :scheduler do
desc 'Expire old job postings'
task expire_job_postings: :environment do
puts 'Expiring old job postings...'
# logic to expire job postings
JobPosting.where('application_deadline < ?', Time.current)
.where(is_expired: false)
.update_all(is_expired: true)
JobPosting.reindex!
puts 'Done.'
end
end
# lib/tasks/scheduler.rake
namespace :scheduler do
desc 'Expire old job postings'
task expire_job_postings: :environment do
puts 'Expiring old job postings...'
# logic to expire job postings
JobPosting.where('application_deadline < ?', Time.current)
.where(is_expired: false)
.update_all(is_expired: true)
JobPosting.reindex!
puts 'Done.'
end
end
Brody
Brodyβ€’11mo ago
if you are running an in code scheduler you have no need to railways cron scheduler
𓆩♑π“†ͺ
this is really strange, I understand cron jobs but I don't understand how railway uses it do I need to define it for railway somewhere?
Brody
Brodyβ€’11mo ago
you are using an in code scheduler, you have no need for railways cron scheduler. what issues are you facing specifically?
𓆩♑π“†ͺ
I have defined the cron job up. How do I run it natively on railway? as I understood it has built-in cron jobs so I don't have to install a gem for it
Brody
Brodyβ€’11mo ago
deploy your repo with the applicable start command to start your in code cron scheduler, nothing special to it. but again, you are already using an in code cron scheduler you have no need for railways cron scheduler
𓆩♑π“†ͺ
I think the docs need to be improved or the UI.
Want results from more Discord servers?
Add your server