Skip to content

Commit

Permalink
Allow extra termination reason when termiating an agreement (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucekdudek authored Jul 12, 2024
1 parent b3d8610 commit f973823
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions golem/resources/agreement/agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ async def create_activity(
return activity

@api_call_wrapper()
async def terminate(self, reason: str = "") -> None:
async def terminate(self, reason: str = "", **extra) -> None:
"""Terminate the agreement.
:param reason: Optional information for the provider explaining why the agreement was
terminated.
:param extra: Optional additional information attached to termination reason, which will be
shared with Provider.
"""
try:
await self.api.terminate_agreement(self.id, request_body={"message": reason})
await self.api.terminate_agreement(self.id, request_body={"message": reason, **extra})
await self.node.event_bus.emit(AgreementClosed(self))
except ApiException as e:
if self._is_permanent_410(e):
Expand Down

0 comments on commit f973823

Please sign in to comment.