How to call sidekiq perform fuction after every five minutes in rails

1k Views Asked by At
require 'sidekiq'

module KYC
  module VerifyInvestor
    class AccreditedVerificationWorker
      include Sidekiq::Worker
       
      def perform()
        ....
      end
    end
  end
end
1

There are 1 best solutions below

0
Pedro Augusto Ramalho Duarte On BEST ANSWER

For free solution you can use sidekiq-cron gem and create a cron job from console to run every 5 minutes:

Sidekiq::Cron::Job.create(name: 'AccreditedVerificationWorker - every 5min', cron: '*/5 * * * *', class: 'KYC::VerifyInvestor::AccreditedVerificationWorker')