Skip to content

Commit

Permalink
fix resources
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes committed Jan 18, 2024
1 parent c2b2024 commit ec394a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
5 changes: 0 additions & 5 deletions backend/controllers/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,6 @@ func SetJobStatusForProject(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error merging PR with automerge option"})
}

type BatchResponse struct {
Status string
JobPaylaods []models.DiggerJobSummary
}

// return batch summary to client
res, err := batch.MapToJsonStruct()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions backend/models/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (j *DiggerJob) MapToJsonStruct() interface{} {
return orchestrator_scheduler.SerializedJob{
DiggerJobId: j.DiggerJobId,
Status: j.Status,
JobString: j.SerializedJob,
ProjectName: job.ProjectName,
ResourcesCreated: j.DiggerJobSummary.ResourcesCreated,
ResourcesUpdated: j.DiggerJobSummary.ResourcesUpdated,
Expand Down
4 changes: 2 additions & 2 deletions backend/models/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,10 @@ func (db *Database) UpdateDiggerJob(job *DiggerJob) error {

func (db *Database) GetDiggerJobsForBatch(batchId uuid.UUID) ([]DiggerJob, error) {
jobs := make([]DiggerJob, 0)
joins := db.GormDB.Joins("LEFT JOIN digger_job_parent_links ON digger_jobs.digger_job_id = digger_job_parent_links.digger_job_id").Preload("Batch").Preload("DiggerJobSummary")
joins := db.GormDB.Joins("LEFT JOIN digger_job_parent_links ON digger_jobs.digger_job_id = digger_job_parent_links.digger_job_id")

var where *gorm.DB
where = joins.Where("digger_jobs.batch_id = ?", batchId)
where = joins.Preload("Batch").Preload("DiggerJobSummary").Where("digger_jobs.batch_id = ?", batchId)

result := where.Find(&jobs)
if result.Error != nil {
Expand Down
1 change: 1 addition & 0 deletions libs/orchestrator/scheduler/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type SerializedJob struct {
DiggerJobId string `json:"digger_job_id"`
Status DiggerJobStatus `json:"status"`
ProjectName string `json:"project_name"`
JobString []byte `json:"job_string"`
ResourcesCreated uint `json:"resources_created"`
ResourcesDeleted uint `json:"resources_deleted"`
ResourcesUpdated uint `json:"resources_updated"`
Expand Down

0 comments on commit ec394a7

Please sign in to comment.