Skip to content

Commit

Permalink
Don't hang up the whole status page if the NFS check hangs?
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Aug 20, 2024
1 parent d7b1fbc commit 56c408b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config/initializers/okcomputer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@

OkComputer::Registry.register 'rails_cache', OkComputer::GenericCacheCheck.new

class DirectoryCheckWithTimeout < OkComputer::DirectoryCheck
def check
Timeout.timeout(5) do
super
end
rescue Timeout::Error
mark_failure
mark_message "Timed out after 5 seconds"
end
end

OkComputer::Registry.register 'stacks_root_dir',
DirectoryCheckWithTimeout.new(Settings.stacks.storage_root)

OkComputer::Registry.register 'stacks_mounted_dir',
OkComputer::DirectoryCheck.new(Settings.stacks.storage_root)

Expand Down

0 comments on commit 56c408b

Please sign in to comment.