Skip to content

Commit a98ad0e

Browse files
committed
Task monitor_payments make less useless check
Don't call pyaleph if there is no execution for user Remove debug executions
1 parent c45346c commit a98ad0e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/aleph/vm/orchestrator/tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ async def check_payment(pool: VmPool):
178178
# and forget the instance message. Compared to just stopping or decreasing the payment stream as the CRN don't know
179179
# which VM it affects.
180180
for vm_hash in list(pool.executions.keys()):
181+
if vm_hash == settings.FAKE_INSTANCE_ID:
182+
continue
181183
message_status = await get_message_status(vm_hash)
182184
if message_status != MessageStatus.PROCESSED:
183185
logger.debug(f"Stopping {vm_hash} execution due to {message_status} message status")
@@ -188,11 +190,13 @@ async def check_payment(pool: VmPool):
188190
for sender, chains in pool.get_executions_by_sender(payment_type=PaymentType.hold).items():
189191
for chain, executions in chains.items():
190192
executions = [execution for execution in executions if execution.is_confidential]
193+
if not executions:
194+
continue
191195
balance = await fetch_balance_of_address(sender)
192196

193197
# Stop executions until the required balance is reached
194198
required_balance = await compute_required_balance(executions)
195-
logger.debug(f"Required balance for Sender {sender} executions: {required_balance}")
199+
logger.debug(f"Required balance for Sender {sender} executions: {required_balance}, {executions}")
196200
# Stop executions until the required balance is reached
197201
while executions and balance < (required_balance + settings.PAYMENT_BUFFER):
198202
last_execution = executions.pop(-1)

0 commit comments

Comments
 (0)