mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-24 22:53:52 +02:00
сделал defer stopapp.GetWaitGroup_Main().Done()
This commit is contained in:
@@ -132,7 +132,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. chatgpt_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. chatgpt_proxy")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. email")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. email_imap")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. fiber_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//ждём пока отправляемых сейчас сообщений будет =0
|
//ждём пока отправляемых сейчас сообщений будет =0
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. kafka_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. minio_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. mssql_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. mssql_gorm")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. NATS_Connect.")
|
log.Warn("Context app is canceled. nats_connect.")
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseConnection()
|
CloseConnection()
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. NATS_Liveness.")
|
log.Warn("Context app is canceled. nats_liveness.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if Ticker != nil {
|
if Ticker != nil {
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. Postgres gorm.")
|
log.Warn("Context app is canceled. postgres_gorm")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. Postgres gorm.")
|
log.Warn("Context app is canceled. postgres_gorm2")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -456,7 +456,7 @@ loop:
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. postgres_gorm.ping")
|
log.Warn("Context app is canceled. postgres_gorm2.ping")
|
||||||
break loop
|
break loop
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
err = port_checker.CheckPort_err(Settings.DB_HOST, Settings.DB_PORT)
|
err = port_checker.CheckPort_err(Settings.DB_HOST, Settings.DB_PORT)
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ func CloseConnection_err() error {
|
|||||||
mutex_Connect.Lock()
|
mutex_Connect.Lock()
|
||||||
defer mutex_Connect.Unlock()
|
defer mutex_Connect.Unlock()
|
||||||
|
|
||||||
err := GetConnection().Close(ctx)
|
err := Conn.Close(ctx)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -248,11 +248,11 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. postgres_pgx")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
stopapp.WaitTotalMessagesSendingNow("Postgres pgx")
|
stopapp.WaitTotalMessagesSendingNow("postgres_pgx")
|
||||||
|
|
||||||
//
|
//
|
||||||
CloseConnection()
|
CloseConnection()
|
||||||
|
|||||||
@@ -204,11 +204,11 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. postgres_sqlx")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
stopapp.WaitTotalMessagesSendingNow("Postgres sqlx")
|
stopapp.WaitTotalMessagesSendingNow("postgres_sqlx")
|
||||||
|
|
||||||
//
|
//
|
||||||
err := CloseConnection()
|
err := CloseConnection()
|
||||||
@@ -316,7 +316,7 @@ loop:
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. postgres_connect.ping")
|
log.Warn("Context app is canceled. postgres_sqlx.ping")
|
||||||
break loop
|
break loop
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
err = port_checker.CheckPort_err(Settings.DB_HOST, Settings.DB_PORT)
|
err = port_checker.CheckPort_err(Settings.DB_HOST, Settings.DB_PORT)
|
||||||
|
|||||||
@@ -264,11 +264,11 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. postgres_stek")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
stopapp.WaitTotalMessagesSendingNow("Postgres stek")
|
stopapp.WaitTotalMessagesSendingNow("postgres_stek")
|
||||||
|
|
||||||
//
|
//
|
||||||
CloseConnectionAll()
|
CloseConnectionAll()
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ func WaitStop() {
|
|||||||
contextmain.CancelContext()
|
contextmain.CancelContext()
|
||||||
}
|
}
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. stopapp")
|
||||||
}
|
}
|
||||||
|
|
||||||
GetWaitGroup_Main().Done()
|
GetWaitGroup_Main().Done()
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. NATS.")
|
log.Warn("Context app is canceled. sync_exchange_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//ждём пока отправляемых сейчас сообщений будет =0
|
//ждём пока отправляемых сейчас сообщений будет =0
|
||||||
stopapp.WaitTotalMessagesSendingNow("nats SyncExchange")
|
stopapp.WaitTotalMessagesSendingNow("sync_exchange_connect")
|
||||||
|
|
||||||
//закрываем соединение
|
//закрываем соединение
|
||||||
CloseConnection()
|
CloseConnection()
|
||||||
@@ -176,7 +176,7 @@ loop:
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled. postgres_pgx.ping")
|
log.Warn("Context app is canceled. sync_exchange_connect.ping")
|
||||||
break loop
|
break loop
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
err = PprofNats1()
|
err = PprofNats1()
|
||||||
|
|||||||
@@ -759,11 +759,11 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. telegram_client")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
stopapp.WaitTotalMessagesSendingNow("telegram")
|
stopapp.WaitTotalMessagesSendingNow("telegram_client")
|
||||||
|
|
||||||
//
|
//
|
||||||
CloseConnection()
|
CloseConnection()
|
||||||
|
|||||||
@@ -235,11 +235,11 @@ func WaitStop() {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-contextmain.GetContext().Done():
|
case <-contextmain.GetContext().Done():
|
||||||
log.Warn("Context app is canceled.")
|
log.Warn("Context app is canceled. whatsapp_connect")
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
stopapp.WaitTotalMessagesSendingNow("whatsapp")
|
stopapp.WaitTotalMessagesSendingNow("whatsapp_connect")
|
||||||
|
|
||||||
//
|
//
|
||||||
StopWhatsApp()
|
StopWhatsApp()
|
||||||
|
|||||||
Reference in New Issue
Block a user