update cicd

This commit is contained in:
2026-04-02 11:01:30 +00:00
parent 863a0ea2f6
commit 5a7f29c116
54 changed files with 4298 additions and 473 deletions

View File

@@ -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,