diff options
Diffstat (limited to 'app/workers/packages/composer/cache_update_worker.rb')
-rw-r--r-- | app/workers/packages/composer/cache_update_worker.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/workers/packages/composer/cache_update_worker.rb b/app/workers/packages/composer/cache_update_worker.rb new file mode 100644 index 00000000000..664fb23284f --- /dev/null +++ b/app/workers/packages/composer/cache_update_worker.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Packages + module Composer + class CacheUpdateWorker + include ApplicationWorker + + feature_category :package_registry + + idempotent! + + def perform(project_id, package_name, last_page_sha) + project = Project.find_by_id(project_id) + + return unless project + + Gitlab::Composer::Cache.new(project: project, name: package_name, last_page_sha: last_page_sha).execute + rescue => e + Gitlab::ErrorTracking.log_exception(e, project_id: project_id) + end + end + end +end |