Where do you want Ruby on Rails to place the files that you want to run periodically?

Asked 2 years ago, Updated 2 years ago, 32 views

Currently, I am thinking of creating a file called app/controller/crawl.rb and running it regularly on crontab, but is this correct?

Or are there any rules on where to put the files to be executed regularly?

I look forward to hearing from you.

ruby-on-rails ruby

2022-09-30 10:44

1 Answers

I don't know about the rules, so it's my personal opinion, but I often write them as tasks in lib/tasks.

scripts/runner, but

  • Write tasks that do not load rails
  • can be classified by namespace, or

There is a , so I'm going to make it a task.


2022-09-30 10:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.