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

module Ci
  module JobArtifacts
    class UpdateUnknownLockedStatusService
      include ::Gitlab::ExclusiveLeaseHelpers
      include ::Gitlab::LoopHelpers

      BATCH_SIZE = 100
      LOOP_TIMEO
    
      def update_locked_status_on_unknown_artifacts
        loop_until(timeout: LOOP_TIMEOUT, limit: @loop_limit) do
          unknown_status_build_ids = safely_ordered_ci_job_artifacts_locked_unknown_relation.pluck_job_id.uniq

          locked_pipe_build_ids = ::Ci::Build
                                    .with_pipeline_locked_artifacts
                                    .id_in(unknown_status_build_ids)
                                    .pluck_primary_key

          @locked_count += update_unknown_artifacts(locked_pipe_build_ids, Ci::JobArtifact.lockeds[:artifacts_locked])

          unlocked_pipe_build_ids = unknown_status_build_ids - locked_pipe_build_ids
          service_response = batch_destroy_artifacts(unlocked_pipe_build_ids)
          @removed_count += service_response[:destroyed_artifacts_count]
        end
      end