Skip to content

Commit

Permalink
fix: fix summarizer issue for jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 17, 2024
1 parent 84d4288 commit fc30def
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jobs/compliance-summarizer-job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (w *Worker) RunJob(ctx context.Context, j types2.Job) error {
zap.Any("resource", resource))
jd.AddComplianceResult(w.logger, j, f, resource)

if f.ComplianceJobID == j.ComplianceJobID {
if f.BenchmarkID == j.BenchmarkID {
addJobSummary(controlSummary, controlView, resourceView, f)
integrationsMap[f.IntegrationID] = true
totalControls[f.ControlID] = true
Expand Down
4 changes: 2 additions & 2 deletions services/describe/db/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ SELECT * FROM (
(
(SELECT id, created_at, updated_at, 'discovery' AS job_type, integration_id, resource_type AS title, status, failure_message FROM describe_integration_jobs WHERE created_at > now() - interval '%[1]s')
UNION ALL
(SELECT id, created_at, updated_at, 'compliance' AS job_type, 'all' AS integration_id, benchmark_id::text AS title, status, failure_message FROM compliance_jobs WHERE created_at > now() - interval '%[1]s')
(SELECT id, created_at, updated_at, 'compliance' AS job_type, 'all' AS integration_id, framework_id::text AS title, status, failure_message FROM compliance_jobs WHERE created_at > now() - interval '%[1]s')
)
) AS t %s ORDER BY %s %s LIMIT ? OFFSET ?;
`, *interval, whereQuery, sortBy, sortOrder)
Expand All @@ -243,7 +243,7 @@ SELECT * FROM (
(
(SELECT id, created_at, updated_at, 'discovery' AS job_type, integration_id, resource_type AS title, status, failure_message FROM describe_integration_jobs WHERE created_at >= ? AND created_at <= ?)
UNION ALL
(SELECT id, created_at, updated_at, 'compliance' AS job_type, 'all' AS integration_id, benchmark_id::text AS title, status, failure_message FROM compliance_jobs WHERE created_at >= ? AND created_at <= ?)
(SELECT id, created_at, updated_at, 'compliance' AS job_type, 'all' AS integration_id, framework_id::text AS title, status, failure_message FROM compliance_jobs WHERE created_at >= ? AND created_at <= ?)
)
) AS t %s ORDER BY %s %s LIMIT ? OFFSET ?;
`, whereQuery, sortBy, sortOrder)
Expand Down
2 changes: 1 addition & 1 deletion services/describe/scheduler_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (s *Scheduler) scheduleDescribeJob(ctx context.Context) {
}

for _, integration := range integrations.Integrations {
if integration.State == models.IntegrationStateSample {
if integration.State == models.IntegrationStateSample || integration.State == models.IntegrationStateInactive {
continue
}
s.logger.Info("running describe job scheduler for integration", zap.String("IntegrationID", integration.IntegrationID))
Expand Down

0 comments on commit fc30def

Please sign in to comment.