mhenrixon/sidekiq-unique-jobs

View on GitHub
lib/sidekiq_unique_jobs/update_version.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module SidekiqUniqueJobs
  #
  # Class UpdateVersion sets the right version in redis
  #
  # @author Mikael Henriksson <mikael@mhenrixon.com>
  #
  class UpdateVersion
    #
    # Sets the right versions in redis
    #
    # @note the version isn't used yet but will be for automatic upgrades
    #
    # @return [true] when version changed
    #
    def self.call
      Script::Caller.call_script(
        :update_version,
        keys: [LIVE_VERSION, DEAD_VERSION],
        argv: [SidekiqUniqueJobs.version],
      )
    end
  end
end