Skip to content

Commit

Permalink
fix(optimus): get replay by filter cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mryashbhardwaj committed Sep 10, 2024
1 parent d15172b commit 0821b26
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions core/scheduler/service/replay_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package service

import (
"fmt"
"time"

"github.com/google/uuid"
"github.com/goto/salt/log"
Expand Down Expand Up @@ -34,7 +33,6 @@ type ReplayRepository interface {
UpdateReplayStatus(ctx context.Context, replayID uuid.UUID, state scheduler.ReplayState, message string) error

GetReplayByFilters(ctx context.Context, projectName tenant.ProjectName, filters ...filter.FilterOpt) ([]*scheduler.ReplayWithRun, error)
GetReplayJobConfig(ctx context.Context, jobTenant tenant.Tenant, jobName scheduler.JobName, scheduledAt time.Time) (map[string]string, error)
GetReplayRequestsByStatus(ctx context.Context, statusList []scheduler.ReplayState) ([]*scheduler.Replay, error)
GetReplaysByProject(ctx context.Context, projectName tenant.ProjectName, dayLimits int) ([]*scheduler.Replay, error)
GetReplayByID(ctx context.Context, replayID uuid.UUID) (*scheduler.ReplayWithRun, error)
Expand Down Expand Up @@ -147,19 +145,6 @@ func (r *ReplayService) GetReplayList(ctx context.Context, projectName tenant.Pr
return r.replayRepo.GetReplaysByProject(ctx, projectName, getReplaysDayLimit)
}

func (r *ReplayService) GetReplayConfig(ctx context.Context, projectName tenant.ProjectName, jobName scheduler.JobName, scheduledAt time.Time) (map[string]string, error) {
job, err := r.jobRepo.GetJob(ctx, projectName, jobName)
if err != nil {
r.logger.Error(fmt.Sprintf("error getting job: %s, project: %s, err:", jobName, projectName), err)
return nil, err
}
config, err := r.replayRepo.GetReplayJobConfig(ctx, job.Tenant, jobName, scheduledAt)
if err != nil {
r.logger.Error(fmt.Sprintf("error getting replay config for job: %s, scheduledAt: %s, err:", jobName, scheduledAt), err)
}
return config, err
}

func (r *ReplayService) GetByFilter(ctx context.Context, project tenant.ProjectName, filters ...filter.FilterOpt) ([]*scheduler.ReplayWithRun, error) {
f := filter.NewFilter(filters...)
if f.Contains(filter.ReplayID) {
Expand Down

0 comments on commit 0821b26

Please sign in to comment.