diff --git a/src/aleph/vm/models.py b/src/aleph/vm/models.py index 111a9c92a..6b40c8aef 100644 --- a/src/aleph/vm/models.py +++ b/src/aleph/vm/models.py @@ -233,6 +233,10 @@ def controller_service(self) -> str: def uses_payment_stream(self) -> bool: return self.message.payment and self.message.payment.is_stream + @property + def uses_payment_credit(self) -> bool: + return self.message.payment and self.message.payment.is_credit + @property def has_resources(self) -> bool: assert self.vm, "The VM attribute has to be set before calling has_resources()" diff --git a/src/aleph/vm/orchestrator/views/__init__.py b/src/aleph/vm/orchestrator/views/__init__.py index feafab4d1..978b57029 100644 --- a/src/aleph/vm/orchestrator/views/__init__.py +++ b/src/aleph/vm/orchestrator/views/__init__.py @@ -465,6 +465,7 @@ async def update_allocations(request: web.Request): execution.vm_hash not in allocations and execution.is_running and not execution.uses_payment_stream + and not execution.uses_payment_credit and not execution.gpus and not execution.is_confidential ):