No release in over a year
add rake task for resque to await DB migration of activerecord
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 5.2.0, < 7.2.0
>= 0
 Project Readme

Resque::Await::Migration

This is a Resque Plugin that allows the Resque Worker to wait until the ActiveRecord's migration has done.

Installation & Usage

Add this line to your application's Gemfile:

gem 'resque-await-migration'

Just do this, your application's Resque Worker will wait for the migration to complete.

How it works

Resque::Await::Migration monitors whether ActiveRecord migration has been applied or not in a child process.

The child process is forked from the ResqueWorker process in the before_first_fork hook of Resque. And, terminated when it is confirmed that the migration has been applied.

Monitoring

If the migration has not yet been applied, it sends a USR2 signal to the Resque Worker to stop the process. When the migration has been applied, it sends a CONT signal and resumes processing.

The monitoring interval and time limit can be specified by the following environment variables.

  • INTERVAL ... monitoring interval seconds. default: 5(sec)
  • AWAIT_MIGRATION_LIMIT ... Time limit waiting for migration to be applied. default: 3600(sec)

Logging

The execution log is output to Resque.logger.

License

The gem is available as open source under the terms of the MIT License.