Class: WhoIsOnline::PresenceController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- WhoIsOnline::PresenceController
- Defined in:
- lib/whoisonline/presence_controller.rb
Instance Method Summary collapse
Instance Method Details
#heartbeat ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/whoisonline/presence_controller.rb', line 18 def heartbeat user = resolve_whoisonline_user WhoIsOnline.track(user) if user head :ok rescue StandardError => e WhoIsOnline.configuration.logger&.warn("whoisonline heartbeat failed: #{e.class} #{e.}") head :ok end |
#offline ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/whoisonline/presence_controller.rb', line 9 def offline user = resolve_whoisonline_user WhoIsOnline.offline(user) if user head :ok rescue StandardError => e WhoIsOnline.configuration.logger&.warn("whoisonline offline failed: #{e.class} #{e.}") head :ok end |