Download src/cli/clear-locks.js from mackenzietechdocs/DocsNavigatorMCP-SUSE-hackathon: direct link, hf CLI and curl.
- Browser
- Download file 771 Bytes
-
https://huggingface.co/spaces/mackenzietechdocs/DocsNavigatorMCP-SUSE-hackathon/resolve/main/src/cli/clear-locks.js
- Command line
-
hf download hf://spaces/mackenzietechdocs/DocsNavigatorMCP-SUSE-hackathon/src/cli/clear-locks.js
-
curl -L -o clear-locks.js https://huggingface.co/spaces/mackenzietechdocs/DocsNavigatorMCP-SUSE-hackathon/resolve/main/src/cli/clear-locks.js
771 Bytes
| /** | |
| * Clear expired locks from the cache database | |
| * Use this if a process crashed and left a stale lock | |
| */ | |
| import { CacheService } from '../services/cache-service.js'; | |
| import dotenv from 'dotenv'; | |
| dotenv.config(); | |
| const cacheService = new CacheService(process.env.PAGE_CACHE_PATH || './data/page-cache.db'); | |
| console.log('\n🔓 Cleaning up expired locks...\n'); | |
| try { | |
| await cacheService.initialize(); | |
| const cleaned = cacheService.cleanupExpiredLocks(); | |
| if (cleaned > 0) { | |
| console.log(`✅ Cleaned up ${cleaned} expired lock(s)\n`); | |
| } else { | |
| console.log('✓ No expired locks found - all clear!\n'); | |
| } | |
| cacheService.close(); | |
| } catch (error) { | |
| console.error('\n❌ Error:', error.message); | |
| process.exit(1); | |
| } | |