You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 20231003045342_migrate_sidekiq_namespaced_jobs.rb
    path of file: ./repos/gitlabhq/db/post_migrate
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class MigrateSidekiqN
    
  def sorted_set_migrate(from, to)
    cursor = '0'

    loop do
      result = []

      Gitlab::Redis::Queues.with do |redis| # rubocop:disable Cop/RedisQueueUsage
        cursor, result = redis.zscan(from, cursor, count: BATCH_SIZE)

        next if result.empty?

        redis.multi do |multi|
          multi.zadd(to, result.map { |k, v| [v, k] })
          multi.zrem(from, result.map { |k, _v| k })
        end
      end

      sleep(0.01)

      break if cursor == '0'
    end
  end