From 8dfcdb4086b24d1380ea3fbdbc8d46a0aba6538f Mon Sep 17 00:00:00 2001 From: timerzz Date: Tue, 3 Sep 2024 15:21:54 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=BF=BD=E7=95=A5=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BA=93=E8=AE=B0=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/database/init.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/database/init.go b/pkg/database/init.go index 627a470..a8aea48 100644 --- a/pkg/database/init.go +++ b/pkg/database/init.go @@ -32,9 +32,10 @@ func InitDefaultDatabase() (*gorm.DB, error) { db.Logger = logger.New( log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{ - SlowThreshold: time.Second, - LogLevel: logger.Warn, - Colorful: true, + SlowThreshold: time.Second, + LogLevel: logger.Warn, + Colorful: true, + IgnoreRecordNotFoundError: true, }, ) return db, nil