Skip to content

Commit

Permalink
Merge pull request #1139 from golemfactory/0.11-fix-network-node-remove
Browse files Browse the repository at this point in the history
fix exception on network node removal
  • Loading branch information
shadeofblue authored Jun 27, 2023
2 parents 934d0e0 + 56e83d5 commit f333f66
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yapapi/services/service_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from types import TracebackType
from typing import TYPE_CHECKING, AsyncContextManager, List, Optional, Set, Tuple, Type, Union

import statemachine.exceptions
from typing_extensions import Final

if TYPE_CHECKING:
Expand Down Expand Up @@ -414,7 +415,11 @@ async def _worker(work_context: WorkContext) -> None:
raise
finally:
if network and service.network_node:
await network.remove_node(work_context.provider_id)
try:
await network.remove_node(work_context.provider_id)
except statemachine.exceptions.TransitionNotAllowed:
# no need to remove the node if the network is not there
pass
service._clear_network_node()
await self._job.engine.accept_payments_for_agreement(self._job.id, agreement.id)
await self._job.agreements_pool.release_agreement(agreement.id, allow_reuse=False)
Expand Down

0 comments on commit f333f66

Please sign in to comment.