Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-29 18:13:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-29 18:13:59 +0300
commit36c4308d16638c60fe2ccc251a2e06e25154ee6a (patch)
tree44e85bbfd2eaeee315b69f25e552a086f6dd4e24 /app
parentd1fe6b3349f1e8cb8477630448f9933e364a1ca8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/runner.rb15
-rw-r--r--app/services/ci/runners/unregister_runner_manager_service.rb2
2 files changed, 17 insertions, 0 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index f3fbfe8193b..5fb982ee21e 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -464,6 +464,21 @@ module Ci
end
end
+ def clear_heartbeat
+ cleared_attributes = {
+ version: nil,
+ revision: nil,
+ platform: nil,
+ architecture: nil,
+ ip_address: nil,
+ executor_type: nil,
+ config: {},
+ contacted_at: nil
+ }
+ merge_cache_attributes(cleared_attributes)
+ update_columns(cleared_attributes)
+ end
+
def pick_build!(build)
tick_runner_queue if matches_build?(build)
end
diff --git a/app/services/ci/runners/unregister_runner_manager_service.rb b/app/services/ci/runners/unregister_runner_manager_service.rb
index ecf6aba09c7..9b3bd4a53e2 100644
--- a/app/services/ci/runners/unregister_runner_manager_service.rb
+++ b/app/services/ci/runners/unregister_runner_manager_service.rb
@@ -20,6 +20,8 @@ module Ci
runner_manager = runner.runner_managers.find_by_system_xid!(system_id)
runner_manager.destroy!
+ runner.clear_heartbeat if runner.runner_managers.empty?
+
ServiceResponse.success
end