update cicd
This commit is contained in:
@@ -28,6 +28,10 @@ type JobService interface {
|
||||
CreateJob(ctx context.Context, userID string, videoID string, name string, config []byte, priority int, timeLimit int64) (*model.Job, error)
|
||||
CancelJob(ctx context.Context, id string) error
|
||||
RetryJob(ctx context.Context, id string) (*model.Job, error)
|
||||
ListDLQ(ctx context.Context, offset, limit int) ([]*dto.DLQEntry, int64, error)
|
||||
GetDLQ(ctx context.Context, id string) (*dto.DLQEntry, error)
|
||||
RetryDLQ(ctx context.Context, id string) (*model.Job, error)
|
||||
RemoveDLQ(ctx context.Context, id string) error
|
||||
}
|
||||
|
||||
type Workflow struct {
|
||||
@@ -187,6 +191,34 @@ func (w *Workflow) RetryJob(ctx context.Context, id string) (*model.Job, error)
|
||||
return w.jobService.RetryJob(ctx, id)
|
||||
}
|
||||
|
||||
func (w *Workflow) ListDLQ(ctx context.Context, offset, limit int) ([]*dto.DLQEntry, int64, error) {
|
||||
if w == nil || w.jobService == nil {
|
||||
return nil, 0, ErrJobServiceUnavailable
|
||||
}
|
||||
return w.jobService.ListDLQ(ctx, offset, limit)
|
||||
}
|
||||
|
||||
func (w *Workflow) GetDLQ(ctx context.Context, id string) (*dto.DLQEntry, error) {
|
||||
if w == nil || w.jobService == nil {
|
||||
return nil, ErrJobServiceUnavailable
|
||||
}
|
||||
return w.jobService.GetDLQ(ctx, id)
|
||||
}
|
||||
|
||||
func (w *Workflow) RetryDLQ(ctx context.Context, id string) (*model.Job, error) {
|
||||
if w == nil || w.jobService == nil {
|
||||
return nil, ErrJobServiceUnavailable
|
||||
}
|
||||
return w.jobService.RetryDLQ(ctx, id)
|
||||
}
|
||||
|
||||
func (w *Workflow) RemoveDLQ(ctx context.Context, id string) error {
|
||||
if w == nil || w.jobService == nil {
|
||||
return ErrJobServiceUnavailable
|
||||
}
|
||||
return w.jobService.RemoveDLQ(ctx, id)
|
||||
}
|
||||
|
||||
func buildJobPayload(videoID, userID, videoURL, format string) ([]byte, error) {
|
||||
return json.Marshal(map[string]any{
|
||||
"video_id": videoID,
|
||||
|
||||
Reference in New Issue
Block a user