Force break all locks (destructive operation).
(cache_dir: Path)
| 114 | |
| 115 | |
| 116 | def force_unlock_all(cache_dir: Path) -> int: |
| 117 | """Force break all locks (destructive operation).""" |
| 118 | print(f"⚠️ WARNING: Forcing unlock of ALL locks") |
| 119 | print("This will break locks from active processes!") |
| 120 | |
| 121 | response = input("Are you sure? (yes/no): ") |
| 122 | |
| 123 | if response.lower() != "yes": |
| 124 | print("Cancelled") |
| 125 | return 1 |
| 126 | |
| 127 | # Force break all in database |
| 128 | db = get_lock_database() |
| 129 | db_broken = db.force_break_all() |
| 130 | |
| 131 | # Force break in cache_dir (legacy files) |
| 132 | cache_broken = force_unlock_cache(cache_dir) |
| 133 | |
| 134 | total = db_broken + cache_broken |
| 135 | if total > 0: |
| 136 | print(f"✅ Broke {total} lock(s)") |
| 137 | else: |
| 138 | print("✅ No locks found") |
| 139 | |
| 140 | return 0 |
| 141 | |
| 142 | |
| 143 | def check_lock(lock_name: str) -> int: |
no test coverage detected