Add ActiveUsers Check
This commit is contained in:
parent
13e88c9395
commit
27e632758f
|
@ -0,0 +1,17 @@
|
||||||
|
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
|
|
@ -32,11 +32,11 @@ namespace :gitlab do
|
||||||
SystemCheck::App::ProjectsHaveNamespaceCheck,
|
SystemCheck::App::ProjectsHaveNamespaceCheck,
|
||||||
SystemCheck::App::RedisVersionCheck,
|
SystemCheck::App::RedisVersionCheck,
|
||||||
SystemCheck::App::RubyVersionCheck,
|
SystemCheck::App::RubyVersionCheck,
|
||||||
SystemCheck::App::GitVersionCheck
|
SystemCheck::App::GitVersionCheck,
|
||||||
|
SystemCheck::App::ActiveUsersCheck
|
||||||
]
|
]
|
||||||
|
|
||||||
SystemCheck.run('GitLab', checks)
|
SystemCheck.run('GitLab', checks)
|
||||||
check_active_users
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -554,10 +554,6 @@ namespace :gitlab do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_active_users
|
|
||||||
puts "Active users: #{User.active.count}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_repo_integrity(repo_dir)
|
def check_repo_integrity(repo_dir)
|
||||||
puts "\nChecking repo at #{repo_dir.color(:yellow)}"
|
puts "\nChecking repo at #{repo_dir.color(:yellow)}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue