blob: 158209c28fd21692164cc877aa12a2034539ace7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# frozen_string_literal: true
module Packages
module Npm
class CleanupStaleMetadataCacheWorker
include ApplicationWorker
include ::Packages::CleanupArtifactWorker
MAX_CAPACITY = 2
data_consistency :sticky
queue_namespace :package_cleanup
feature_category :package_registry
deduplicate :until_executed
idempotent!
def max_running_jobs
MAX_CAPACITY
end
private
def model
Packages::Npm::MetadataCache
end
def log_metadata(npm_metadata_cache)
log_extra_metadata_on_done(:npm_metadata_cache_id, npm_metadata_cache.id)
end
def log_cleanup_item(npm_metadata_cache)
logger.info(
structured_payload(
npm_metadata_cache_id: npm_metadata_cache.id
)
)
end
end
end
end
|