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

@@ -264,7 +264,11 @@ func initializePGSQLProvider() error {
dbHandle.SetConnMaxLifetime(240 * time.Second)
dbHandle.SetConnMaxIdleTime(120 * time.Second)
provider = &PGSQLProvider{dbHandle: dbHandle}
return nil
ctx, cancel := context.WithTimeout(context.Background(), defaultSQLQueryTimeout)
defer cancel()
return dbHandle.PingContext(ctx)
}
func getPGSQLHostsAndPorts(configHost string, configPort int) (string, string) {