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: dispatch_worker.rb
    path of file: ./repos/gitlabhq/app/workers/repository_check
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RepositoryCheck
  class DispatchWorker # rubocop
    
    def perform
      return unless Gitlab::CurrentSettings.repository_checks_enabled

      try_obtain_lease do
        each_eligible_shard do |shard_name|
          RepositoryCheck::BatchWorker.perform_async(shard_name)
        end
      end
    end