Class: Chronicle::ApiLogs::Updater
- Inherits:
-
Object
- Object
- Chronicle::ApiLogs::Updater
- Defined in:
- app/services/chronicle/api_logs/updater.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(request_id, frontend_response_time_ms) ⇒ Updater
constructor
A new instance of Updater.
Constructor Details
#initialize(request_id, frontend_response_time_ms) ⇒ Updater
Returns a new instance of Updater.
4 5 6 7 |
# File 'app/services/chronicle/api_logs/updater.rb', line 4 def initialize(request_id, frontend_response_time_ms) @request_id = request_id @frontend_response_time_ms = frontend_response_time_ms end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/services/chronicle/api_logs/updater.rb', line 9 def call api_log = ApiLog.find_by(request_id: @request_id) raise NotFoundError, "API log not found with request_id: #{@request_id}" if api_log.nil? api_log.update!(frontend_response_time_ms: @frontend_response_time_ms) api_log end |