Skip to content

Commit

Permalink
Fix: error when user balance is zero and no remaining executions to r… (
Browse files Browse the repository at this point in the history
#661)

Fix: error when user balance is zero and no remaining executions to remove
  • Loading branch information
olethanh authored Jul 29, 2024
1 parent 15e70e7 commit bd3a735
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aleph/vm/orchestrator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bd3a735

Please sign in to comment.