From bd2fb50c819c2b180758308ef3751e7ea73e6ab7 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 17 Feb 2025 00:40:43 +0100 Subject: [golang] implement shipyards visits --- golang/pkg/agent/contracting.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'golang/pkg/agent/contracting.go') diff --git a/golang/pkg/agent/contracting.go b/golang/pkg/agent/contracting.go index 0f07170..a3eb7aa 100644 --- a/golang/pkg/agent/contracting.go +++ b/golang/pkg/agent/contracting.go @@ -11,7 +11,7 @@ func (a *agent) autoContracting(ship *model.Ship) { defer a.wg.Done() contracts, err := a.client.MyContracts() if err != nil { - a.sendShipError(fmt.Errorf("failed to get my contracts: %w", err), ship) + a.channel <- fmt.Errorf("failed to get my contracts with ship %s: %w", ship.Symbol, err) return } for _, contract := range contracts { @@ -21,12 +21,12 @@ func (a *agent) autoContracting(ship *model.Ship) { now := time.Now() if now.Before(contract.Terms.Deadline) { if err := a.runContract(&contract, ship); err != nil { - a.sendShipError(fmt.Errorf("failed to run contracts: %w", err), ship) + a.channel <- fmt.Errorf("failed to run contracts with ship %s: %w", ship.Symbol, err) return } } } - a.sendShipError(fmt.Errorf("failed to run contracts: negotiating new contracts is not implemented yet"), ship) + a.channel <- fmt.Errorf("failed to run contracts: negotiating new contracts is not implemented yet") // TODO //for { // negotiate -- cgit v1.2.3