mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-16 01:00:17 +01:00
bug fix: n8n revert
This commit is contained in:
@@ -789,10 +789,10 @@ services:
|
||||
|
||||
##### N8N Container
|
||||
|
||||
def check_container_health(self, container_name, max_retries=3, delay=10):
|
||||
return True
|
||||
def check_container_health(self, container_name, max_retries=3, delay=80):
|
||||
"""
|
||||
Check if a container is healthy and running
|
||||
Check if a container is running, accepting both healthy and unhealthy states
|
||||
Total wait time will be 4 minutes (3 retries * 80 seconds)
|
||||
"""
|
||||
try:
|
||||
for attempt in range(max_retries):
|
||||
@@ -802,15 +802,16 @@ services:
|
||||
if container.status == 'running':
|
||||
health = container.attrs.get('State', {}).get('Health', {}).get('Status')
|
||||
|
||||
if health == 'healthy' or health is None:
|
||||
# Accept both healthy and unhealthy states as long as container is running
|
||||
if health in ['healthy', 'unhealthy'] or health is None:
|
||||
return True
|
||||
elif health == 'unhealthy':
|
||||
else:
|
||||
health_logs = container.attrs.get('State', {}).get('Health', {}).get('Log', [])
|
||||
if health_logs:
|
||||
last_log = health_logs[-1]
|
||||
logging.writeToFile(f'Container health check failed: {last_log.get("Output", "")}')
|
||||
|
||||
logging.writeToFile(f'Container {container_name} not healthy, attempt {attempt + 1}/{max_retries}')
|
||||
logging.writeToFile(f'Container {container_name} not running, attempt {attempt + 1}/{max_retries}')
|
||||
time.sleep(delay)
|
||||
|
||||
return False
|
||||
@@ -1220,7 +1221,7 @@ services:
|
||||
'N8N_HOST': self.data['finalURL'],
|
||||
'NODE_ENV': 'production',
|
||||
'WEBHOOK_URL': f"https://{self.data['finalURL']}",
|
||||
'N8N_PUSH_BACKEND': 'websocket',
|
||||
'N8N_PUSH_BACKEND': 'sse',
|
||||
'GENERIC_TIMEZONE': 'UTC',
|
||||
'N8N_ENCRYPTION_KEY': 'auto',
|
||||
'N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS': 'true',
|
||||
|
||||
Reference in New Issue
Block a user