Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions agents/go.mod

This file was deleted.

136 changes: 0 additions & 136 deletions agents/go.sum

This file was deleted.

4 changes: 2 additions & 2 deletions agents/native/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func cacheFile(uri *uri) (*ArtifactReference, error) {
if err != nil {
return nil, err
}
defer fOrig.Close()
defer func() { _ = fOrig.Close() }()

hasher := sha256.New()
if _, err := io.Copy(hasher, fOrig); err != nil {
Expand Down Expand Up @@ -113,7 +113,7 @@ func cacheObjectStoreArtifact(uri *uri, nc *nats.Conn) (*ArtifactReference, erro
if err != nil {
return nil, err
}
defer fCache.Close()
defer func() { _ = fCache.Close() }()

_, err = fCache.Write(bin_b)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions agents/native/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func createTestBinary(t testing.TB, tmpDir string) (string, string, int) {
if err != nil {
t.Errorf("Failed to write to Go file: %v", err)
}
f.Close()
be.NilErr(t, f.Close())

// Command to compile the Go code into a binary
// go build -trimpath -ldflags="-buildid= -X 'main.buildTime=static_time'"
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestArtifactNats(t *testing.T) {
be.Equal(t, binHash, ref.Digest)
be.Equal(t, binLen, ref.Size)

os.RemoveAll(tDir)
be.NilErr(t, os.RemoveAll(tDir))
}

func TestArtifactFile(t *testing.T) {
Expand All @@ -139,7 +139,7 @@ func TestArtifactFile(t *testing.T) {
be.Equal(t, binHash, ref.Digest)
be.Equal(t, binLen, ref.Size)

os.RemoveAll(workingDir)
be.NilErr(t, os.RemoveAll(workingDir))
}

const testProg string = `package main
Expand Down
4 changes: 2 additions & 2 deletions agents/native/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"time"

"github.com/nats-io/nats.go"
"github.com/synadia-io/nex/sdk/go/agent"
"github.com/synadia-io/nex/internal"
"github.com/synadia-io/nex/models"
"github.com/synadia-io/nex/sdk/go/agent"
)

type nexletState struct {
Expand Down Expand Up @@ -300,7 +300,7 @@ func (n *nexletState) RemoveWorkload(namespace, workloadId string) error {
w.SetState(models.WorkloadStateStopping)
n.Unlock()

err := stopProcess(w.Process)
err := internal.StopProcess(w.Process)
// this will hit if the process is already stopped
if errors.Is(err, os.ErrProcessDone) {
n.logger.Debug("process already exited", slog.String("workloadId", workloadId), slog.String("namespace", namespace))
Expand Down
17 changes: 0 additions & 17 deletions agents/native/stop_process.go

This file was deleted.

35 changes: 0 additions & 35 deletions agents/native/stop_process_windows.go

This file was deleted.

7 changes: 4 additions & 3 deletions client/client_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ func BenchmarkClientAuction(b *testing.B) {
ctx := b.Context()

nexNodes := _test.StartNexus(b, ctx, server.ClientURL(), tc.clusterSize, false)
defer func() {
defer func(b *testing.B) {
for _, nn := range nexNodes {
nn.Shutdown()
shutdownErr := nn.Shutdown()
b.Logf("failed to shutdown nex node: %s", shutdownErr)
}
}()
}(b)
nc.Close()

// open a new fresh connection for the nex client
Expand Down
Loading
Loading