dr. strange
dr. strange

Reputation: 665

Rails: How to manage rake tasks likewise migrations

I have rails app deployed over multiple instances and had too many rake tasks to run over different instances so it is hard to manage which rake tasks is already run or which one remaining.

is there any way to manage it from db side, as schema_migrations table managed by migrations. if yes then, i want know how migrations exactly works?.

any suggestions?.

Upvotes: 0

Views: 203

Answers (3)

Ashish Agrawal
Ashish Agrawal

Reputation: 381

You can use Progress Bar gem to monitor the progress of a particular rake task.

And according to the above suggestion, automated deployment through capistrano is a good option. You can manage the rake tasks running sequence in the cap script.

Upvotes: 0

Santosh Mohanty
Santosh Mohanty

Reputation: 482

You can use resque-scheduler(https://github.com/resque/resque-scheduler) to manage and track your tasks .

Upvotes: 0

songyy
songyy

Reputation: 4563

  1. Correct way: use deploy automation. Capistrano is a good choice. Then you'll never need to worry about things like running rake task
  2. I think the rake tasks should have no side effects if you execute it multiple times. If the task is implemented that way, then there's no need to worry about which has been done and which is not.
  3. I think if you want to get a status tracking for the Rake Task, a simple way is to implemented a model to record the execution status of the rake task, and update the model each time rake task is done.

Upvotes: 2

Related Questions