|
|
@@ -99,7 +99,7 @@ func (repo *KubeEventRepository) CreateEvent(
|
|
|
// basic fixed-length buffer
|
|
|
if count >= 500 {
|
|
|
// first, delete the matching sub events
|
|
|
- err := repo.db.Debug().Exec(`
|
|
|
+ err := repo.db.Exec(`
|
|
|
DELETE FROM kube_sub_events
|
|
|
WHERE kube_event_id IN (
|
|
|
SELECT id FROM kube_events k2 WHERE (k2.project_id = ? AND k2.cluster_id = ?) AND k2.id NOT IN (
|
|
|
@@ -113,7 +113,7 @@ func (repo *KubeEventRepository) CreateEvent(
|
|
|
}
|
|
|
|
|
|
// then, delete the matching events
|
|
|
- err = repo.db.Debug().Exec(`
|
|
|
+ err = repo.db.Exec(`
|
|
|
DELETE FROM kube_events
|
|
|
WHERE (project_id = ? AND cluster_id = ?) AND id NOT IN (
|
|
|
SELECT id FROM kube_events k2 WHERE (k2.project_id = ? AND k2.cluster_id = ?) ORDER BY k2.updated_at desc, k2.id desc LIMIT 499
|