Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix: fix route table total time
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 23, 2019
1 parent 3097617 commit b0e3215
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gnes/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,12 @@ def _path_import(absolute_path):
return module, spec


def make_route_table(routes, exclude_frontend: bool = False):
def make_route_table(routes, exclude_frontend: bool = False, jitter: float = 1e-8):
route_time = []
if exclude_frontend:
total_duration = get_duration(routes[0].start_time, routes[0].end_time)
total_duration = get_duration(routes[0].start_time, routes[0].end_time) + jitter
else:
total_duration = get_duration(routes[0].start_time, routes[-1].end_time)
total_duration = get_duration(routes[0].start_time, routes[-1].end_time) + jitter
sum_duration = 0
for k in routes[(1 if exclude_frontend else 0):]:
d = get_duration(k.start_time, k.end_time)
Expand Down

0 comments on commit b0e3215

Please sign in to comment.