Skip to content

Commit

Permalink
Change total_occupancy directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jan 5, 2021
1 parent 49db986 commit bec92c2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6140,16 +6140,15 @@ def _reevaluate_occupancy_worker(self, ws: WorkerState):
""" See reevaluate_occupancy """
old: double = ws._occupancy
new: double = 0
diff: double
ts: TaskState
est: double
for ts in ws._processing:
est = self.set_duration_estimate(ts, ws)
new += est

ws._occupancy = new
diff = new - old
self.total_occupancy += diff
self.total_occupancy -= old
self.total_occupancy += new
self.check_idle_saturated(ws)

# significant increase in duration
Expand Down

0 comments on commit bec92c2

Please sign in to comment.