From a1a4ed8aca3e353f92de49419f4ad96cf36a0e63 Mon Sep 17 00:00:00 2001 From: Juan Font Date: Fri, 26 Jul 2024 16:17:42 +0000 Subject: [PATCH] Fix time vars --- app.go | 4 ++-- types_audit_event.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app.go b/app.go index 26503e4..28a6c0f 100644 --- a/app.go +++ b/app.go @@ -90,7 +90,7 @@ func (s *GitLabLogStreamer) preloadDBRecentData() error { // and insert them into s.latestAuditLogEvents auditEvents := []*AuditEvent{} - err := s.db.Where("created_at > ?", time.Now().AddDate(0, 0, -PreloadEventsPeriodDays)).Find(&auditEvents).Error + err := s.db.Where("time > ?", time.Now().AddDate(0, 0, -PreloadEventsPeriodDays)).Find(&auditEvents).Error if err != nil { return err } @@ -102,7 +102,7 @@ func (s *GitLabLogStreamer) preloadDBRecentData() error { // load the auth log events from the last preloadEventsPeriodDays from s.db // and insert them into s.latestAuthEvents authEvent := []*AuthEvent{} - err = s.db.Where("created_at > ?", time.Now().AddDate(0, 0, -PreloadEventsPeriodDays)).Find(&authEvent).Error + err = s.db.Where("time > ?", time.Now().AddDate(0, 0, -PreloadEventsPeriodDays)).Find(&authEvent).Error if err != nil { return err } diff --git a/types_audit_event.go b/types_audit_event.go index 6d43aa6..dcdcd34 100644 --- a/types_audit_event.go +++ b/types_audit_event.go @@ -24,7 +24,6 @@ type AuditEvent struct { AuthorName string `json:"author_name"` EntityID int64 `json:"entity_id"` EntityType AuthorClass `json:"entity_type"` - CreatedAt time.Time `json:"created_at"` IPAddress string `json:"ip_address"` With *With `json:"with,omitempty"` TargetID *int64 `json:"target_id"`