<p>How do I make the <code>celery -A app worker</code> command to consume only a single task and then exit.</p>
<p>I want to run celery workers as a kubernetes Job that finishes after handling a single task.</p>
<p>I'm using KEDA for autoscaling workers according to queue messages.
I want to run celery workers as jobs for long running tasks, as suggested in the documentation:
<a href="https://keda.sh/docs/1.5/concepts/scaling-deployments/#long-running-executions" rel="nofollow noreferrer">KEDA long running execution</a></p>

<p>There's not really anything specific for this. You would have to hack in your own driver program, probably via a custom concurrency module. Are you trying to use Keda ScaledJobs or something? You would just use a ScaledObject instead.</p>
