diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-05 00:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-05 00:08:53 +0300 |
commit | 269e52662aceba62b91424e87f4def90ecc81e6c (patch) | |
tree | 6ba6a0ce47114c969ce92e7e726ee303013bebcf /app/workers | |
parent | bbc241ab7fff1f6854a70eb56ee70b0dad2b6144 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/ml/experiment_tracking/associate_ml_candidate_to_package_worker.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/workers/ml/experiment_tracking/associate_ml_candidate_to_package_worker.rb b/app/workers/ml/experiment_tracking/associate_ml_candidate_to_package_worker.rb index d7e9f4b4b98..b9c75c01f81 100644 --- a/app/workers/ml/experiment_tracking/associate_ml_candidate_to_package_worker.rb +++ b/app/workers/ml/experiment_tracking/associate_ml_candidate_to_package_worker.rb @@ -11,17 +11,15 @@ module Ml idempotent! def handle_event(event) - candidate = Ml::Candidate.find_from_package_name(event.data[:name]) - package = Packages::Package.find_by_id(event.data[:id]) - - return unless candidate && package + return unless (candidate = Ml::Candidate.with_project_id_and_iid(event.data[:project_id], event.data[:version])) + return unless (package = Packages::Package.find_by_id(event.data[:id])) candidate.package = package candidate.save! end def self.handles_event?(event) - event.generic? && Ml::Candidate.candidate_id_for_package(event.data[:name]).present? + event.generic? && Ml::Experiment.package_for_experiment?(event.data[:name]) end end end |