diff --git a/background/tasks.py b/background/tasks.py index eb883f5..936ff07 100644 --- a/background/tasks.py +++ b/background/tasks.py @@ -37,6 +37,9 @@ async def flush_buffer(): product_ids = await buffer.get_tasks() total_products = len(product_ids) + if not product_ids: + logging.info('Buffer is empty') + return logging.info(f'Flushing buffer with {total_products} products') await process_update(product_ids) logging.info(f'Buffer flushed with {total_products} products')