Class: Ci::Runners::ReconcileExistingRunnerVersionsService

Inherits:
Object
  • Object
show all
Defined in:
app/services/ci/runners/reconcile_existing_runner_versions_service.rb

Constant Summary collapse

VERSION_BATCH_SIZE =
100

Instance Method Summary collapse

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/services/ci/runners/reconcile_existing_runner_versions_service.rb', line 8

def execute
  insert_result = insert_runner_versions
  total_deleted = cleanup_runner_versions(insert_result[:versions_from_runners])
  total_updated = update_status_on_outdated_runner_versions(insert_result[:versions_from_runners])

  ServiceResponse.success(payload: {
    total_inserted: insert_result[:new_record_count],
    total_updated: total_updated,
    total_deleted: total_deleted
  })
end