1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-25 23:02:22 +02:00

сделал LogInfo_Connected(err)

This commit is contained in:
Nikitin Aleksandr
2024-11-15 13:52:29 +03:00
parent a03d22215f
commit ce9c53ba0d
2 changed files with 11 additions and 1 deletions

View File

@@ -109,6 +109,11 @@ func Connect_WithApplicationName_err(ApplicationName string) error {
FillSettings()
}
//
if contextmain.GetContext().Err() != nil {
return contextmain.GetContext().Err()
}
//get the database connection URL.
dsn := GetDSN(ApplicationName)

View File

@@ -93,7 +93,12 @@ func Connect_WithApplicationName_err(ApplicationName string) error {
FillSettings()
}
//ctxMain := context.Background()
//
if contextmain.GetContext().Err() != nil {
return contextmain.GetContext().Err()
}
//
ctxMain := contextmain.GetContext()
ctx, cancel := context.WithTimeout(ctxMain, 60*time.Second)
defer cancel()