feat 忽略找不到数据库记录的报错
This commit is contained in:
parent
07cb2d39ed
commit
8dfcdb4086
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user