Poke me on GitHub

[Rails] Run Queued Tasks Using ‘delayed_job’, Now With Intervals!

If you don’t already know, ‘delayed_job’ is a database based asynchronously priority queue system extracted from Shopify.

I was seeking for a lightweight, easy to use solution for queueing tasks, ‘delayed_job’ fits the bill almost perfectly. ;)

One thing we needed to do for a Rails 2 project at Envato, was to queue the tasks and to run them one after another, at a set interval. ‘delayed_job’ unfortunately doesn’t come with this feature.

So, instead of searching for more complicated solutions or reinventing the wheels, I made a couple of commits to my fork to add this functionality as well as to fix some rails 3 compatibility issues.

Now you can simply add the following line to your config/initializers/delayed_job_config.rb file to have the tasks run at 1 minute interval.

Delayed::Worker.run_interval = 60

A pull request has been issued, hopefully it’ll come as a standard feature soon. :)

Back to top



 

Who am I?

My LinkedIn Profile

me

Grew up in Shanghai, China, I quickly became interested in computers and the Internet at the age of 13. I started off by creating simple websites using basic HTML I learnt from reading computer magazines. Later on I worked in online publishing, marketing and web hosting while studying in high school. After being a 'webmaster' for a few years, I began my career in web development and design. I studied for Bachelor of Information Technology and Systems at Monash University in Melbourne, Australia. I now work as a web developer at Envato.

skills

I am primarily a Ruby and PHP developer as well as a front-end/UI developer. In my spare time I also try to do as much creative designs as I could in order to keep my design skills polished. I also focus strongly on user experience and user interface design.

exp

During high school I worked as a part time site editor for a gadget website as well as a freelancing author, I contributed articles for many of the Chinese IT magazines. Soon I became fascinated by the World Wide Web so I started making my own websites and started hacking scripts. I began working as a part time web developer shortly after I graduated from high school. During the four years of study at TAFE and university, I worked as a freelancer and focused mostly on web development and design. I worked full time as a web developer at a Melbourne-based media agency before landing my current job at Envato.

oss

I am an active open source developer who contributes to many of the projects on GitHub.

Here is a list of my open source projects.

I have also made contribution to these open source projects.

hi!

Please feel free to shoot me an email if you would like to get in touch. I am also happy to provide estimates and consultancy to any web based projects. You may write to me in English or in Chinese. :)