diff --git a/src/aleph/vm/orchestrator/tasks.py b/src/aleph/vm/orchestrator/tasks.py index fc627e29..006de6e6 100644 --- a/src/aleph/vm/orchestrator/tasks.py +++ b/src/aleph/vm/orchestrator/tasks.py @@ -158,7 +158,7 @@ async def monitor_payments(app: web.Application): required_balance = await compute_required_balance(executions) logger.debug(f"Required balance for Sender {sender} executions: {required_balance}") # Stop executions until the required balance is reached - while balance < (required_balance + settings.PAYMENT_BUFFER): + while executions and balance < (required_balance + settings.PAYMENT_BUFFER): last_execution = executions.pop(-1) logger.debug(f"Stopping {last_execution} due to insufficient balance") await pool.stop_vm(last_execution.vm_hash)