improved some of the tasks to use fewer goroutines

This commit is contained in:
2025-10-04 13:56:30 -06:00
parent 445f50a5c0
commit c7f5c57e82
5 changed files with 77 additions and 32 deletions
+5 -1
View File
@@ -20,12 +20,16 @@ var amdb *sqlx.DB
// SetupDb sets up the database and associated items.
func SetupDb() (func(), error) {
var fn1 func() = nil
db, err := sqlx.Open(config.GlobalConfig.Database.Driver, config.GlobalConfig.Database.Dsn)
if err == nil {
amdb = db
// TODO: additional initialization
fn1 = setupAuditWriter()
}
return func() {
if fn1 != nil {
fn1()
}
amdb.Close()
}, err
}