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

active_users_check.rb « app « system_check « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8446c2fc2c874c28b343dd7a895ba3f39ae54733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module SystemCheck
  module App
    class ActiveUsersCheck < SystemCheck::BaseCheck
      set_name 'Active users:'

      def multi_check
        active_users = User.active.count

        if active_users > 0
          $stdout.puts active_users.to_s.color(:green)
        else
          $stdout.puts active_users.to_s.color(:red)
        end
      end
    end
  end
end