Skip to content

Commit

Permalink
progress toward fixing issue with fulfillments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ctri-The-Third committed Dec 17, 2023
1 parent b03dc46 commit 430d12f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion straders_sdk/client_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,8 @@ def contracts_fulfill(self, contract: Contract):
if not resp:
print(f"failed to fulfill contract {resp.status_code}, {resp.error}")
return resp

if "contract" in resp.data:
contract.update(resp.data["contract"])
return contract


Expand Down
4 changes: 2 additions & 2 deletions straders_sdk/client_mediator.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def ship_dock(self, ship: "Ship"):
self.db_client.update(ship)
return resp

def ship_refuel(self, ship: "Ship", from_cargo:bool = False ):
def ship_refuel(self, ship: "Ship", from_cargo: bool = False):
"""/my/ships/{shipSymbol}/refuel"""

start = datetime.now()
Expand Down Expand Up @@ -1138,7 +1138,7 @@ def contracts_fulfill(self, contract: "Contract") -> SpaceTradersResponse:
self.logging_client.contracts_fulfill(
contract, resp, (datetime.now() - start).total_seconds()
)

if resp:
self.update(resp)
self.db_client.update(contract)
Expand Down

0 comments on commit 430d12f

Please sign in to comment.