Skip to content

Commit 20bb6ae

Browse files
committed
chore(automation): fix linter errors
1 parent 06c8d2f commit 20bb6ae

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

internal/services/crossseed/service.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8338,6 +8338,12 @@ func (s *Service) executeExternalProgram(ctx context.Context, instanceID int, to
83388338
return
83398339
}
83408340

8341+
if ctx == nil {
8342+
ctx = context.Background()
8343+
} else {
8344+
ctx = context.WithoutCancel(ctx)
8345+
}
8346+
83418347
// Get current settings to check if external program is configured
83428348
settings, err := s.GetAutomationSettings(ctx)
83438349
if err != nil {
@@ -8354,7 +8360,7 @@ func (s *Service) executeExternalProgram(ctx context.Context, instanceID int, to
83548360
// Execute in a separate goroutine to avoid blocking the cross-seed operation
83558361
go func() {
83568362
// Get torrent data from sync manager
8357-
targetTorrent, found, err := s.syncManager.HasTorrentByAnyHash(context.Background(), instanceID, []string{torrentHash})
8363+
targetTorrent, found, err := s.syncManager.HasTorrentByAnyHash(ctx, instanceID, []string{torrentHash})
83588364
if err != nil {
83598365
log.Error().Err(err).Int("instanceId", instanceID).Str("torrentHash", torrentHash).Msg("Failed to get torrent for external program execution")
83608366
return
@@ -8372,8 +8378,7 @@ func (s *Service) executeExternalProgram(ctx context.Context, instanceID int, to
83728378
Msg("Executing external program for cross-seed injection")
83738379

83748380
// Execute using the shared external programs service
8375-
execCtx := context.WithoutCancel(ctx)
8376-
result := s.externalProgramService.Execute(execCtx, externalprograms.ExecuteRequest{
8381+
result := s.externalProgramService.Execute(ctx, externalprograms.ExecuteRequest{
83778382
ProgramID: programID,
83788383
Torrent: targetTorrent,
83798384
InstanceID: instanceID,

web/src/components/instances/preferences/WorkflowsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ function RuleSummary({ rule }: { rule: Automation }) {
465465
</Badge>
466466
</TooltipTrigger>
467467
<TooltipContent>
468-
<p>Program ID: {conditions.externalProgram.programId}</p>
468+
<p>Program ID: {conditions.externalProgram.programId ?? "-"}</p>
469469
</TooltipContent>
470470
</Tooltip>
471471
)}

0 commit comments

Comments
 (0)