Skip to content

Commit

Permalink
Use Timeout.timeout instead of Object#timeout
Browse files Browse the repository at this point in the history
This change suppresses the following warning:

```
warning: Object#timeout is deprecated, use Timeout.timeout instead.
```
  • Loading branch information
mishina2228 committed Jan 8, 2022
1 parent 92c06aa commit 67c7f9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/god/system/slash_proc_poller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def percent_cpu
# read from them. Try to use this sparingly as it is expensive.
def self.readable?(path)
begin
timeout(1) { File.read(path) }
Timeout.timeout(1) { File.read(path) }
rescue Timeout::Error
false
end
Expand Down

0 comments on commit 67c7f9b

Please sign in to comment.