rebuild router when processing updates
This commit is contained in:
parent
0306b3fa87
commit
e5f53aa399
2 changed files with 5 additions and 1 deletions
|
@ -126,6 +126,10 @@ class MapUpdate(models.Model):
|
|||
from c3nav.mapdata.render.renderdata import LevelRenderData
|
||||
LevelRenderData.rebuild()
|
||||
|
||||
logger.info('Rebuilding router...')
|
||||
from c3nav.routing.router import Router
|
||||
Router.rebuild()
|
||||
|
||||
transaction.on_commit(
|
||||
lambda: cache.set('mapdata:last_processed_update', new_updates[-1].to_tuple, 900)
|
||||
)
|
||||
|
|
|
@ -33,7 +33,7 @@ class Router:
|
|||
return max(area.get_altitudes(point)[0] for area in areas if area.geometry_prep.intersects(point))
|
||||
|
||||
@classmethod
|
||||
def build(cls):
|
||||
def rebuild(cls):
|
||||
levels_query = Level.objects.prefetch_related('buildings', 'spaces', 'altitudeareas',
|
||||
'spaces__holes', 'spaces__columns',
|
||||
'spaces__obstacles', 'spaces__lineobstacles',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue