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

Time:05-25

require 'sidekiq'

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

CodePudding user response:

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')
  • Related