From 4ed150bf313fff0b0dde354efc5f19a6d282c485 Mon Sep 17 00:00:00 2001 From: Braktar Date: Thu, 30 Jun 2022 09:55:51 +0200 Subject: [PATCH] Ensure job removal --- CHANGELOG.md | 2 ++ api/v01/vrp.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd9ae3f55..041531571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ ### Fixed +- In some cases, the jobs were impossible to remove [#432](https://github.com/Mapotempo/optimizer-api/pull/432) + ## [v1.9.0] - 2022-06-07 ### Added diff --git a/api/v01/vrp.rb b/api/v01/vrp.rb index e38e6a8fb..6772cca39 100644 --- a/api/v01/vrp.rb +++ b/api/v01/vrp.rb @@ -306,8 +306,8 @@ class Vrp < APIBase }, with: VrpResult) end result_object = nil # rubocop:disable Lint/UselessAssignment - OptimizerWrapper.job_remove(params[:api_key], id) end + OptimizerWrapper.job_remove(params[:api_key], id) if job&.dig('options', 'api_key') == params[:api_key] end end end