MCPcopy
hub / github.com/celery/celery / pool_shrink

Function pool_shrink

celery/worker/control.py:554–561  ·  view source on GitHub ↗

Shrink pool by n processes/threads.

(state, n=1, **kwargs)

Source from the content-addressed store, hash-verified

552 signature='[N=1]',
553)
554def pool_shrink(state, n=1, **kwargs):
555 """Shrink pool by n processes/threads."""
556 if state.consumer.controller.autoscaler:
557 return nok("pool_shrink is not supported with autoscale. Adjust autoscale range instead.")
558 else:
559 state.consumer.pool.shrink(n)
560 state.consumer._update_prefetch_count(-n)
561 return ok('pool will shrink')
562
563
564@control_command()

Callers

nothing calls this directly

Calls 4

nokFunction · 0.85
okFunction · 0.85
shrinkMethod · 0.45

Tested by

no test coverage detected