Skip to content

Commit

Permalink
Reset global params object in calculator at beginning of V2 request.
Browse files Browse the repository at this point in the history
If we were doing a request with the old V1 API, you could set some global
flags that would not be reseted when then calling a V2 API.

We were hitting the assert in forward_calculation in the forwardCalculation() call
  • Loading branch information
greenscientist authored and tahini committed Oct 10, 2023
1 parent d54fe37 commit 4493623
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connection_scan_algorithm/src/transit_routing_http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ int main(int argc, char** argv) {
calculator.benchmarking.clear();

// prepare parameters:
calculator.params.setDefaultValues(); // Reset global params object (TODO only need while its global)
std::vector<std::pair<std::string, std::string>> parametersWithValues;
auto queryFields = request->parse_query_string();
for(auto &field : queryFields)
Expand Down Expand Up @@ -540,6 +541,7 @@ int main(int argc, char** argv) {
calculator.benchmarking.clear();

// prepare parameters:
calculator.params.setDefaultValues(); // Reset global params object (TODO only need while its global)
std::vector<std::pair<std::string, std::string>> parametersWithValues;
auto queryFields = request->parse_query_string();
for(auto &field : queryFields)
Expand Down Expand Up @@ -611,6 +613,7 @@ int main(int argc, char** argv) {
calculator.benchmarking.clear();

// prepare parameters:
calculator.params.setDefaultValues(); // Reset global params object (TODO only need while its global)
std::vector<std::pair<std::string, std::string>> parametersWithValues;
auto queryFields = request->parse_query_string();
for(auto &field : queryFields)
Expand Down

0 comments on commit 4493623

Please sign in to comment.