Fix Docker apply crash and add safe profile test flow
Remove invalid _mirror_manager from daemon.json that prevented Docker from starting. Add 2-minute test apply with auto-rollback, final apply confirmation, emergency-restore CLI/UI, and post-restart Docker health checks. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from datetime import datetime, timezone
|
||||
from app.extensions import db
|
||||
from app.models import ApplyLog, Mirror, Profile, ProfileItem, Setting, SystemState
|
||||
from app.models import utcnow
|
||||
from app.services.applier import apply_profile, rollback_apply
|
||||
from app.services.applier import APPLY_MODE_FINAL, apply_profile, rollback_apply
|
||||
from app.services.tester import get_best_mirror, test_mirror
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -78,7 +78,7 @@ def run_auto_switch(app) -> None:
|
||||
|
||||
item.mirror_id = best.id
|
||||
db.session.commit()
|
||||
apply_profile(profile)
|
||||
apply_profile(profile, mode=APPLY_MODE_FINAL)
|
||||
_increment_switch_count()
|
||||
logger.info("Auto-switched %s to %s", category, best.name)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user