// 文件: database/database.go
ifdialect=="sqlite3"{// We use the database connection inside the handlers from the http
// framework, therefore concurrent access occurs. Sqlite cannot handle
// concurrent writes, so we limit sqlite to one connection.
// see https://github.com/mattn/go-sqlite3/issues/274
db.DB().SetMaxOpenConns(1)}ifdialect=="mysql"{// Mysql has a setting called wait_timeout, which defines the duration
// after which a connection may not be used anymore.
// The default for this setting on mariadb is 10 minutes.
// See https://github.com/docker-library/mariadb/issues/113
db.DB().SetConnMaxLifetime(9*time.Minute)}