Skip to content

Commit 43f0ecd

Browse files
committed
debug: Remove log statements from TrRoutingServiceBackend's route
reverts changes done in this file in 657976c This log statements were wrongly placed as the request is a promise and the log happened before awaiting for the promise completion. Also, with the TransitRoutingService in the backend, this log is not necessary anymore, as the caller already has log statements.
1 parent 4bbe2ce commit 43f0ecd

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

packages/chaire-lib-backend/src/utils/trRouting/TrRoutingServiceBackend.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,14 @@ class TrRoutingServiceBackend {
140140
parameters: TrRoutingApi.TransitRouteQueryOptions,
141141
hostPort: TrRoutingApi.HostPort = {}
142142
): Promise<TrRoutingApi.TrRoutingV2.RouteResponse> {
143-
const origDestStr = `${parameters.originDestination[0].geometry.coordinates.join(',')} to ${parameters.originDestination[1].geometry.coordinates.join(',')}`;
144-
console.log(`tripRouting: Getting route from trRouting for ${origDestStr}`);
145-
try {
146-
const trRoutingQuery = this.routeOptionsToQueryString(parameters);
147-
148-
const result = this.request<TrRoutingApi.TrRoutingV2.RouteResponse>(
149-
trRoutingQuery,
150-
hostPort.host,
151-
hostPort.port,
152-
'v2/route'
153-
);
154-
console.log(`tripRouting: Done getting route from trRouting for ${origDestStr}`);
155-
return result;
156-
} catch (error) {
157-
console.log(`tripRouting: Error getting route from trRouting for ${origDestStr}`);
158-
throw error;
159-
}
143+
const trRoutingQuery = this.routeOptionsToQueryString(parameters);
144+
145+
return this.request<TrRoutingApi.TrRoutingV2.RouteResponse>(
146+
trRoutingQuery,
147+
hostPort.host,
148+
hostPort.port,
149+
'v2/route'
150+
);
160151
}
161152

162153
summary(parameters: TrRoutingApi.TransitRouteQueryOptions): Promise<TrRoutingApi.TrRoutingV2.SummaryResponse> {

0 commit comments

Comments
 (0)