Skip to content

Commit ebe411d

Browse files
committed
chore: make the grumpy linter less grumpy
1 parent e708650 commit ebe411d

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

app/cmd/upload/noui.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ func (upCmd *UpCmd) runNoUI(ctx context.Context, app *app.Application) error {
1919
ctx, cancel := context.WithCancelCause(ctx)
2020
lock := sync.RWMutex{}
2121
needToResumeJobs := false
22-
defer func() {
22+
defer func(ctx context.Context) {
2323
if needToResumeJobs {
2424
// resume jobs if the UI was interrupted, the call context is already cancelled, so let's use a fresh one fpr this call
2525
_ = upCmd.resumeJobs(context.Background(), app)
2626
needToResumeJobs = false
2727
}
28-
}()
28+
}(ctx)
2929
defer cancel(nil)
3030

3131
var preparationDone atomic.Bool

app/cmd/upload/run.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func (UpCmd *UpCmd) pauseJobs(ctx context.Context, app *app.Application) error {
117117
if err != nil {
118118
UpCmd.app.Jnl().Log().Error("Immich Job command sent", "pause", name, "err", err.Error())
119119
return err
120-
121120
}
122121
UpCmd.app.Jnl().Log().Info("Immich Job command sent", "pause", name)
123122
}

app/cmd/upload/ui.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ func (upCmd *UpCmd) runUI(ctx context.Context, app *app.Application) error {
5555
uiApp := tview.NewApplication()
5656
ui := upCmd.newUI(ctx, app)
5757

58-
defer func() {
58+
defer func(ctx context.Context) {
5959
if needToResumeJobs {
6060
// resume jobs if the UI was interrupted, the call context is already cancelled, so let's use a fresh one fpr this call
6161
_ = upCmd.resumeJobs(context.Background(), app)
6262
needToResumeJobs = false
6363
}
64-
}()
64+
}(ctx)
6565
defer cancel(nil)
6666
pages := tview.NewPages()
6767

immich/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (ic *ImmichClient) SendJobCommand(
6969
command JobCommand,
7070
force bool,
7171
) (resp SendJobCommandResponse, err error) {
72-
err = ic.newServerCall(ctx, EndPointSendJobCommand).do(putRequest("/jobs/"+string(jobID),
72+
err = ic.newServerCall(ctx, EndPointSendJobCommand).do(putRequest("/jobs/"+jobID,
7373
setJSONBody(struct {
7474
Command JobCommand `json:"command"`
7575
Force bool `json:"force"`

0 commit comments

Comments
 (0)