Skip to content

Commit

Permalink
Fixing case where dragon sight is used prepull
Browse files Browse the repository at this point in the history
  • Loading branch information
xephero committed Jun 11, 2018
1 parent c6ae4a4 commit f689fcd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tethercalc.py
Expand Up @@ -103,10 +103,19 @@ def get_tethers(report, start, end):
tether_set = [tether
for tether in tethers
if tether['source'] == event['sourceID'] and 'end' not in tether]
# add it to the discovered tether
if tether_set:
tether = tether_set[0]

tether['end'] = event['timestamp']
tether['end'] = event['timestamp']
# if there is no start event, add one and set it to 20s prior
else:
print(max(event['timestamp'] - 20000, start))
tethers.append({
'source': event['sourceID'],
'target': event['targetID'],
'start': max(event['timestamp'] - 20000, start),
'end': event['timestamp'],
})

return tethers

Expand Down

0 comments on commit f689fcd

Please sign in to comment.