Class: ProconBypassMan::SyncDeviceStatsJob

Inherits:
BaseJob
  • Object
show all
Extended by:
HasExternalApiSetting
Defined in:
lib/procon_bypass_man/background/jobs/sync_device_stats_job.rb

Class Method Summary collapse

Methods included from HasExternalApiSetting

api_server

Methods inherited from BaseJob

re_enqueue_if_failed

Methods included from Background::JobPerformable

#perform, #perform_async

Class Method Details

.pathObject



12
13
14
15
# File 'lib/procon_bypass_man/background/jobs/sync_device_stats_job.rb', line 12

def self.path
  device_id = ProconBypassMan.device_id
  "/api/devices/#{ProconBypassMan.device_id}/device_statuses"
end

.perform(status) ⇒ Object

Parameters:

  • status (Symbol)


5
6
7
8
9
10
# File 'lib/procon_bypass_man/background/jobs/sync_device_stats_job.rb', line 5

def self.perform(status)
  ProconBypassMan::SendDeviceStatsHttpClient.new(
    path: path,
    server: api_server,
  ).post(status: status, pbm_session_id: ProconBypassMan.session_id)
end