Remove SystemTimer and use stdlib Timeout directly

SystemTimer was only needed on ruby 1.8, and we dropped support for
that a long time ago.
This commit is contained in:
Andy Allan 2020-12-23 14:25:58 +00:00
parent 279787943e
commit 4f304e2301
7 changed files with 11 additions and 17 deletions

View file

@ -37,6 +37,8 @@
module Api
class AmfController < ApiController
require "timeout"
include Potlatch
before_action :check_api_writable
@ -130,7 +132,7 @@ module Api
def amf_handle_error_with_timeout(call, rootobj, rootid, &block)
amf_handle_error(call, rootobj, rootid) do
OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError, &block)
Timeout.timeout(Settings.api_timeout, OSM::APITimeoutError, &block)
end
end