MCPcopy
hub / github.com/celery/celery / update

Method update

celery/worker/autoscale.py:98–109  ·  view source on GitHub ↗
(self, max=None, min=None)

Source from the content-addressed store, hash-verified

96 self.pool.maintain_pool()
97
98 def update(self, max=None, min=None):
99 with self.mutex:
100 if max is not None:
101 if max < self.processes:
102 self._shrink(self.processes - max)
103 self._update_consumer_prefetch_count(max)
104 self.max_concurrency = max
105 if min is not None:
106 if min > self.processes:
107 self._grow(min - self.processes)
108 self.min_concurrency = min
109 return self.max_concurrency, self.min_concurrency
110
111 def scale_up(self, n):
112 self._last_scale_up = monotonic()

Callers 15

test_updateMethod · 0.95
_sync_withMethod · 0.45
_merge_revoked_v3Method · 0.45
_merge_revoked_v2Method · 0.45
_revokeFunction · 0.45
helloFunction · 0.45
autoscaleFunction · 0.45
_loop_cycleFunction · 0.45
hybrid_to_proto2Function · 0.45

Calls 3

_shrinkMethod · 0.95
_growMethod · 0.95