mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
improve
This commit is contained in:
parent
1c5561231b
commit
aa21b81586
5 changed files with 26 additions and 24 deletions
|
@ -9,7 +9,7 @@ import (
|
|||
"codeberg.org/codeberg/pages/server/database"
|
||||
)
|
||||
|
||||
func openCertDB(ctx *cli.Context) (certDB database.CertDB, close func(), err error) {
|
||||
func openCertDB(ctx *cli.Context) (certDB database.CertDB, closeFn func(), err error) {
|
||||
if ctx.String("db-type") != "" {
|
||||
log.Trace().Msg("use xorm mode")
|
||||
certDB, err = database.NewXormDB(ctx.String("db-type"), ctx.String("db-conn"))
|
||||
|
@ -35,11 +35,11 @@ The simplest way is, to use './pages certs migrate' and set environment var DB_T
|
|||
}
|
||||
}
|
||||
|
||||
close = func() {
|
||||
closeFn = func() {
|
||||
if err := certDB.Close(); err != nil {
|
||||
log.Error().Err(err)
|
||||
}
|
||||
}
|
||||
|
||||
return certDB, close, nil
|
||||
return certDB, closeFn, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue