Skip to content

Commit

Permalink
Allow subsequent detailed_solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
braktar committed Sep 11, 2024
1 parent 0376e23 commit cd06637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v01/vrp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class Vrp < APIBase
graph: result_object[:graph]
},
geojsons: OutputHelper::Result.generate_geometry(result_object)
}, with: VrpResult, detailed_solutions: job&.status&.to_sym == :completed || result_object.dig(:configuration, :intermediate_solutions))
}, with: VrpResult, detailed_solutions: job.nil? || job.status&.to_sym == :completed || result_object.dig(:configuration, :intermediate_solutions))
end
# set nil to release memory because puma keeps the grape api endpoint object alive
stored_result = nil # rubocop:disable Lint/UselessAssignment
Expand Down
4 changes: 3 additions & 1 deletion models/vrp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ def self.convert_position_relations(hash)

r[:linked_service_ids]&.each{ |id|
to_modify = hash[:services].find{ |s| s[:id] == id }
raise OptimizerWrapper::DiscordantProblemError.new(r[:type].to_s + error_msg) unless to_modify[:activity]
if to_modify.nil? || !to_modify.key?(:activity)
raise OptimizerWrapper::DiscordantProblemError.new(r[:type].to_s + error_msg)
end

to_modify[:activity][:position] = type_conversion[r[:type]]
}
Expand Down

0 comments on commit cd06637

Please sign in to comment.