I set a cron job to run a rake task. This task will do somethings, such as send a post request...
If timeout, process cannot finished normally. How to set a timeout time, if this time is surpassed,
then the rake task will exit.
I set a cron job to run a rake task. This task will do somethings, such as send a post request...
If timeout, process cannot finished normally. How to set a timeout time, if this time is surpassed,
then the rake task will exit.
require 'timeout'
status = Timeout::timeout(5) {
# Something that should be interrupted if it takes too much time...
}