Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Sammy Oina <[email protected]>
  • Loading branch information
SammyOina committed Jan 9, 2025
1 parent 20c214f commit de8c517
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion agent/cvm/api/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (client *CVMClient) executeRun(ctx context.Context, runReq *cvm.Computation
client.mu.Lock()
defer client.mu.Unlock()

err := client.sp.Start(agent.AgentConfig{
err := client.sp.Start(ctx, agent.AgentConfig{
Port: runReq.AgentConfig.Port,
Host: runReq.AgentConfig.Host,
CertFile: runReq.AgentConfig.CertFile,
Expand Down
4 changes: 2 additions & 2 deletions agent/cvm/server/cvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewServerProvider(logger *slog.Logger, svc agent.Service) *AgentServer {
}
}

func (as *AgentServer) Start(cfg agent.AgentConfig, cmp agent.Computation) error {
func (as *AgentServer) Start(ctx context.Context, cfg agent.AgentConfig, cmp agent.Computation) error {
if cfg.Port == "" {
cfg.Port = defSvcGRPCPort
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func (as *AgentServer) Start(cfg agent.AgentConfig, cmp agent.Computation) error
return err
}

ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(ctx)

as.gs = grpcserver.New(ctx, cancel, svcName, agentGrpcServerConfig, registerAgentServiceServer, as.logger, qp, authSvc)

Expand Down
6 changes: 3 additions & 3 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
g, ctx := errgroup.WithContext(ctx)

var exitCode int
defer mglog.ExitWithError(&exitCode)

var cfg config
if err := env.Parse(&cfg); err != nil {
log.Fatalf("failed to load %s configuration : %s", svcName, err)
}

var exitCode int
defer mglog.ExitWithError(&exitCode)

var level slog.Level
if err := level.UnmarshalText([]byte(cfg.LogLevel)); err != nil {
log.Println(err)
Expand Down
1 change: 0 additions & 1 deletion internal/logger/protohandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func (h *handler) Handle(_ context.Context, r slog.Record) error {
if err != nil {
return err
}

}

return nil
Expand Down
1 change: 0 additions & 1 deletion internal/logger/protohandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestHandleMessageSuccess(t *testing.T) {

// TestHandleMessageFailure tests the caching mechanism when the write fails.
func TestHandleMessageFailure(t *testing.T) {

protohandler := NewProtoHandler(&failedWriter{}, nil, make(chan *cvm.ClientStreamMessage, 1))
record := slog.Record{
Time: time.Now(),
Expand Down

0 comments on commit de8c517

Please sign in to comment.