If the worker has burst mode enabled, it seems like it does not shut down immediately even if there are 0 jobs in the queue to start with.
Is there a way to enable this? I tried playing around with max_burst_jobs but it doesn't seem to change this behavior.
Potentially, I think it's possible to add something like this to the main function:
if self.burst:
queued_jobs = await self.pool.zcard(self.queue_name)
if queued_jobs == 0:
logger.info('No jobs in queue, worker terminating in burst mode.')
return