summaryrefslogtreecommitdiff
path: root/lib/gitlab/project_stats_refresh_conflicts_logger.rb
blob: 3e7eecce89c2b1902ff3dcd183a79f6a038ba888 (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
# frozen_string_literal: true

module Gitlab
  class ProjectStatsRefreshConflictsLogger # rubocop:disable Gitlab/NamespacedClass
    def self.warn_artifact_deletion_during_stats_refresh(project_id:, method:)
      payload = Gitlab::ApplicationContext.current.merge(
        message: 'Deleted artifacts undergoing refresh',
        method: method,
        project_id: project_id
      )

      Gitlab::AppLogger.warn(payload)
    end

    def self.warn_request_rejected_during_stats_refresh(project_id)
      payload = Gitlab::ApplicationContext.current.merge(
        message: 'Rejected request due to project undergoing stats refresh',
        project_id: project_id
      )

      Gitlab::AppLogger.warn(payload)
    end

    def self.warn_skipped_artifact_deletion_during_stats_refresh(project_ids:, method:)
      payload = Gitlab::ApplicationContext.current.merge(
        message: 'Skipped deleting artifacts undergoing refresh',
        method: method,
        project_ids: project_ids
      )

      Gitlab::AppLogger.warn(payload)
    end
  end
end