diff options
| author | Teddy Wing | 2018-03-13 18:45:28 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-03-14 16:42:02 +0100 |
| commit | a5d070093a2561c4924a030338db9064cdff7a16 (patch) | |
| tree | a11bd9aeb397d279d816e5515d3d8070499d8280 | |
| parent | 13135a5251f2af3e85bb2bb1be9866477b7414e9 (diff) | |
| download | chouette-core-a5d070093a2561c4924a030338db9064cdff7a16.tar.bz2 | |
RouteWayCostWorker: Add comment about recursive workers
Explain why we need to skip and un-skip the callback.
Refs #6095
| -rw-r--r-- | app/workers/route_way_cost_worker.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/workers/route_way_cost_worker.rb b/app/workers/route_way_cost_worker.rb index 2ec8cdff9..d6bfed592 100644 --- a/app/workers/route_way_cost_worker.rb +++ b/app/workers/route_way_cost_worker.rb @@ -5,6 +5,8 @@ class RouteWayCostWorker Referential.find(referential_id).switch route = Chouette::Route.find(route_id) + # Prevent recursive worker spawning since this call updates the + # `costs` field of the route. Chouette::Route.skip_callback(:save, :after, :calculate_costs!) RouteWayCostCalculator.new(route).calculate! |
