Fix
This commit is contained in:
parent
fe3bf8a309
commit
1f5f708a62
1 changed files with 4 additions and 4 deletions
8
drain.go
8
drain.go
|
|
@ -95,7 +95,7 @@ func processAllDrainingContainersGlobally(db *sql.DB, hostname string) {
|
|||
clientInfo, err := getClientInfoByClientTitle(db, clientTitle)
|
||||
if err != nil {
|
||||
log.Printf(" ⚠ Ошибка получения данных клиента из БД: %v", err)
|
||||
checkAndProcessExistingDrainMarkers(clientTitle, &processedClients)
|
||||
checkAndProcessExistingDrainMarkers(clientTitle, 0, &processedClients)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ func processAllDrainingContainersGlobally(db *sql.DB, hostname string) {
|
|||
processedClients++
|
||||
} else {
|
||||
log.Printf(" ✓ Клиент должен быть здесь, проверяю устаревшие drain-маркеры")
|
||||
checkAndProcessExistingDrainMarkers(clientTitle, &processedClients)
|
||||
checkAndProcessExistingDrainMarkers(clientTitle, clientInfo.ContainersCount, &processedClients)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ func processAllDrainingContainersGlobally(db *sql.DB, hostname string) {
|
|||
processDrainingAngieConfigs()
|
||||
}
|
||||
|
||||
func checkAndProcessExistingDrainMarkers(clientTitle string, processedCount *int) {
|
||||
func checkAndProcessExistingDrainMarkers(clientTitle string, containersCount int, processedCount *int) {
|
||||
hasAnyDrainMarkers := false
|
||||
for containerNum := 1; containerNum <= MaxContainersPerClient; containerNum++ {
|
||||
if _, err := os.Stat(fmt.Sprintf("/tmp/ptaf-drain-ptaf_%s_%03d", clientTitle, containerNum)); err == nil {
|
||||
|
|
@ -180,7 +180,7 @@ func checkAndProcessExistingDrainMarkers(clientTitle string, processedCount *int
|
|||
}
|
||||
if hasAnyDrainMarkers {
|
||||
log.Printf(" → Найдены drain-маркеры, обрабатываю")
|
||||
processDrainingContainers(clientTitle, 0)
|
||||
processDrainingContainers(clientTitle, containersCount)
|
||||
*processedCount++
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue