diff --git a/CHANGELOG.md b/CHANGELOG.md index b7f7166be..e3ae24538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,12 @@ ## V103.0.1-dev ### Added - - API: Allow commas for float fields [#205](https://github.com/cartoway/planner-web/pull/205) + - API: + - Allow commas for float fields [#205](https://github.com/cartoway/planner-web/pull/205) + - Capture sentry from API [#209](https://github.com/cartoway/planner-web/pull/209) - Planning: Add router name to vehicle selector [#202](https://github.com/cartoway/planner-web/pull/202) - Destination: Allow commas for float columns during import [#203](https://github.com/cartoway/planner-web/pull/203) & [#208](https://github.com/cartoway/planner-web/pull/208) + - Device: Set a 2s timeout for StgTelematics[#209](https://github.com/cartoway/planner-web/pull/209) - Zoning: - Simplify polygons geometries [#207](https://github.com/cartoway/planner-web/pull/207) - Destroy unconsistent polygons [#210](https://github.com/cartoway/planner-web/pull/210) diff --git a/app/api/v01/api.rb b/app/api/v01/api.rb index dfd1f6f40..735438dc7 100644 --- a/app/api/v01/api.rb +++ b/app/api/v01/api.rb @@ -117,6 +117,7 @@ def error!(*args) response[:message] = messages.join(' ') error!(response.merge(status: 409), 409, e.backtrace) else + Sentry.capture_exception(e) error!(response.merge(status: 500), 500, e.backtrace) end end diff --git a/app/api/v100/api.rb b/app/api/v100/api.rb index fd5f56c4c..1a0d948e3 100644 --- a/app/api/v100/api.rb +++ b/app/api/v100/api.rb @@ -100,6 +100,7 @@ def error!(*args) response[:message] = messages.join(' ') error!(response.merge(status: 409), 409, e.backtrace) else + Sentry.capture_exception(e) error!(response.merge(status: 500), 500, e.backtrace) end end diff --git a/lib/devices/stg_telematics.rb b/lib/devices/stg_telematics.rb index 3f6ca1836..83ae8d119 100644 --- a/lib/devices/stg_telematics.rb +++ b/lib/devices/stg_telematics.rb @@ -167,7 +167,9 @@ def rest_client_with_method(url, token, params, method = :post) method: method, url: url, headers: { content_type: :json, accept: :json, 'auth-code': token }.delete_if{ |_k, v| v.nil? }, - payload: params.to_json + payload: params.to_json, + open_timeout: 2, + read_timeout: 2 ) rescue RestClient::RequestTimeout raise DeviceServiceError.new("#{I18n.t('errors.stg_telemativs.timeout')}")