fix: 修改容器创建和启动失败时的日志记录,确保在达到最大重试次数后返回而不是终止程序
This commit is contained in:
parent
7049546225
commit
63fa995bdf
@ -37,7 +37,8 @@ func init() {
|
|||||||
if err := container.CreateAndStartContainer(); err != nil {
|
if err := container.CreateAndStartContainer(); err != nil {
|
||||||
retryCount++
|
retryCount++
|
||||||
if retryCount > maxRetries {
|
if retryCount > maxRetries {
|
||||||
log.Fatalf("Failed to create and start container after %d retries: %v", maxRetries, err)
|
log.Printf("Failed to create and start container after %d retries: %v", maxRetries, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
log.Printf("CreateAndStartContainer failed (attempt %d/%d): %v", retryCount, maxRetries, err)
|
log.Printf("CreateAndStartContainer failed (attempt %d/%d): %v", retryCount, maxRetries, err)
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user