Windows: start the service in a goroutine

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-05-23 12:59:27 +02:00
parent 2b77709a04
commit 255985b7b0
3 changed files with 27 additions and 11 deletions

View File

@@ -243,7 +243,11 @@ func initializeMySQLProvider() error {
dbHandle.SetConnMaxLifetime(240 * time.Second)
dbHandle.SetConnMaxIdleTime(120 * time.Second)
provider = &MySQLProvider{dbHandle: dbHandle}
return nil
ctx, cancel := context.WithTimeout(context.Background(), defaultSQLQueryTimeout)
defer cancel()
return dbHandle.PingContext(ctx)
}
func getMySQLConnectionString(redactedPwd bool) (string, error) {
var connectionString string