Skip to content

Commit 658832e

Browse files
committed
Redis configuration check
The bin/check script now checks if Redis is configured properly.
1 parent b26d1a0 commit 658832e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

bin/check

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resp = GitlabNet.new.check
1212
if resp.code == "200"
1313
print 'OK'
1414
else
15-
puts "FAILED. code: #{resp.code}"
15+
abort "FAILED. code: #{resp.code}"
1616
end
1717

1818
puts "\nCheck directories and files: "
@@ -25,7 +25,22 @@ dirs.each do |dir|
2525
if File.exists?(dir)
2626
print 'OK'
2727
else
28-
puts "FAILED"
28+
abort "FAILED"
2929
end
3030
puts "\n"
3131
end
32+
33+
print "Testing redis-cli executable: "
34+
system(*config.redis_command, '--version', err: '/dev/null')
35+
if $?.success?
36+
print "Sending ping to redis server: "
37+
system(*config.redis_command, 'ping', err: '/dev/null', out: '/dev/null')
38+
if $?.success?
39+
print 'OK'
40+
else
41+
abort "FAILED"
42+
end
43+
else
44+
abort "FAILED"
45+
end
46+
puts "\n"

0 commit comments

Comments
 (0)