if time is zero return nil
ci.vdhsn.com/push Build is failing Details

pull/1/head
Adam Veldhousen 11 months ago
parent 6b4232a9b9
commit dc4fe8851f
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -15,6 +15,10 @@ type PGRunnerStorage struct {
}
func (db *PGRunnerStorage) CreateScrapeJob(ctx context.Context, target string) (sj domain.ScrapeJob, err error) {
if target == "" {
target = "ALL"
}
rsj, err := db.Queries.CreateScrapeJob(ctx, target)
if err != nil {
return domain.ScrapeJob{}, err

@ -34,7 +34,7 @@ func (rh *runnerHandler) StartSync(ctx context.Context, cmd *api.SyncParameters)
Id: int32(out.Job.ID),
AuctionsFound: int32(out.Job.AuctionsFound),
CreatedTs: timestamppb.New(out.Job.Started),
CompletedTs: timestamppb.New(out.Job.Completed),
CompletedTs: nil,
TargetSiteName: out.Job.TargetSite,
Errors: out.Job.Errors,
}, nil
@ -51,14 +51,21 @@ func (rh *runnerHandler) Status(ctx context.Context, cmd *api.StatusFilter) (*ap
}
for _, j := range out.Jobs {
var completedTime *timestamppb.Timestamp
if !j.Completed.IsZero() {
completedTime = timestamppb.New(j.Completed)
}
result.Results = append(result.Results, &api.SyncStatus{
Id: int32(j.ID),
AuctionsFound: int32(j.AuctionsFound),
CreatedTs: timestamppb.New(j.Started),
CompletedTs: timestamppb.New(j.Completed),
CompletedTs: completedTime,
TargetSiteName: j.TargetSite,
Errors: j.Errors,
})
}
return result, nil

Loading…
Cancel
Save