@@ -24,11 +24,11 @@ def self.start_server!(team, server, wait = 1)
2424 SlackRubyBotServer ::Config . service_class . instance . send ( :run_callbacks , :error , team , e )
2525 case e . message
2626 when 'account_inactive' , 'invalid_auth' then
27- SlackRubyBotServer ::Config . logger . error "#{ team . name } : #{ e . message } , team will be deactivated."
28- SlackRubyBotServer ::RealTime :: Service . instance . deactivate! team
29- elsef
27+ SlackRubyBotServer ::Config . service_class . instance . logger . error "#{ team . name } : #{ e . message } , team will be deactivated."
28+ SlackRubyBotServer ::Config . service_class . instance . deactivate! team
29+ else
3030 wait = e . retry_after if e . is_a? ( Slack ::Web ::Api ::Errors ::TooManyRequestsError )
31- SlackRubyBotServer ::Config . logger . error "#{ team . name } : #{ e . message } , restarting in #{ wait } second(s)."
31+ SlackRubyBotServer ::Config . service_class . instance . logger . error "#{ team . name } : #{ e . message } , restarting in #{ wait } second(s)."
3232 sleep ( wait )
3333 start_server! team , server , [ wait * 2 , 60 ] . min
3434 end
@@ -37,8 +37,8 @@ def self.start_server!(team, server, wait = 1)
3737 def restart! ( _wait = 1 )
3838 # when an integration is disabled, a live socket is closed, which causes the default behavior of the client to restart
3939 # it would keep retrying without checking for account_inactive or such, we want to restart via service which will disable an inactive team
40- logger . info "#{ team . name } : socket closed, restarting ..."
41- SlackRubyBotServer ::RealTime :: Service . instance . restart! team
40+ SlackRubyBotServer :: Config . service_class . instance . logger . info "#{ team . name } : socket closed, restarting ..."
41+ SlackRubyBotServer ::Config . service_class . instance . restart! team
4242 open!
4343 end
4444
0 commit comments