Skip to content

Commit

Permalink
Bugfix: cache overwritten in case of reused network codes (streams).
Browse files Browse the repository at this point in the history
  • Loading branch information
javiquinte committed Sep 20, 2017
1 parent a09aaa2 commit cb593b2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions routeutils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ def cacheStations(routingTable, stationTable):
services = set(urlparse(rt.address).netloc for rt in ptRT[st])
for rt in ptRT[st]:
if rt.service == 'station':
result = getStationCache(st, rt)
if result is None:
result = getStationCache(st, rt)
else:
result.extend(getStationCache(st, rt))

if result is None:
logging.warning('No Station-WS defined for this stream! No cache!')
Expand All @@ -162,10 +165,7 @@ def cacheStations(routingTable, stationTable):

for service in services:
try:
if isinstance(stationTable[service][st], list):
stationTable[service][st].expand(result)
else:
stationTable[service][st] = result
stationTable[service][st] = result
except KeyError:
stationTable[service] = dict()
stationTable[service][st] = result
Expand Down

0 comments on commit cb593b2

Please sign in to comment.