Skip to content

Commit

Permalink
add task to check channel for clips
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibbp committed Nov 6, 2024
1 parent 5e2bf96 commit 407378b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions internal/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ func (s *Service) StartTask(ctx context.Context, task string) error {
}
log.Info().Str("task_id", fmt.Sprintf("%d", task.Job.ID)).Msgf("task created")

case "check_clips":
task, err := s.RiverClient.Client.Insert(ctx, tasks_periodic.TaskCheckChannelForNewClipsArgs{}, nil)
if err != nil {
return fmt.Errorf("error inserting task: %v", err)
}
log.Info().Str("task_id", fmt.Sprintf("%d", task.Job.ID)).Msgf("task created")

case "get_jwks":
task, err := s.RiverClient.Client.Insert(ctx, tasks_periodic.FetchJWKSArgs{}, nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/transport/http/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type TaskService interface {
}

type StartTaskRequest struct {
Task string `json:"task" validate:"required,oneof=check_live check_vod get_jwks storage_migration prune_videos save_chapters update_stream_vod_ids"`
Task string `json:"task" validate:"required,oneof=check_live check_vod check_clips get_jwks storage_migration prune_videos save_chapters update_stream_vod_ids"`
}

// StartTask godoc
Expand Down

0 comments on commit 407378b

Please sign in to comment.