Skip to content

Commit 7f6daba

Browse files
committed
refactor(api): filter out running events from healthz
1 parent 3b7703d commit 7f6daba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/pkg/api/data_access/healthz.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (d *DataAccessService) GetHealthz(ctx context.Context, showAll bool) types.
4444
metadata
4545
FROM status_reports
4646
LEFT JOIN clean_shutdown_events cse ON status_reports.emitter = clean_shutdown_events.emitter
47-
WHERE expires_at > now() and deployment_type = {deployment_type:String} and (status_reports.inserted_at < cse.inserted_at or cse.inserted_at is null)
47+
WHERE expires_at > now() and deployment_type = {deployment_type:String} and (status_reports.inserted_at < cse.inserted_at or cse.inserted_at is null) AND event_id != {running_event_id:String}
4848
ORDER BY
4949
event_id ASC,
5050
emitter ASC,
@@ -100,7 +100,7 @@ func (d *DataAccessService) GetHealthz(ctx context.Context, showAll bool) types.
100100
response.Reports = make(map[string][]types.HealthzResult)
101101
response.ReportingUUID = utils.GetUUID()
102102
response.DeploymentType = utils.Config.DeploymentType
103-
err := db.ClickHouseReader.SelectContext(ctx, &results, query, ch.Named("deployment_type", utils.Config.DeploymentType), ch.Named("clean_shutdown_event_id", string(constants.Event_MonitoringCleanShutdown)))
103+
err := db.ClickHouseReader.SelectContext(ctx, &results, query, ch.Named("deployment_type", utils.Config.DeploymentType), ch.Named("clean_shutdown_event_id", string(constants.Event_MonitoringCleanShutdown)), ch.Named("running_event_id", string(constants.Running)))
104104
if err != nil {
105105
response.Reports["response_error"] = []types.HealthzResult{
106106
{

0 commit comments

Comments
 (0)