1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-11 05:59:16 +00:00

Support debug

This commit is contained in:
Tw93
2025-12-05 17:16:46 +08:00
parent 5761fd87c8
commit b939442e92
11 changed files with 160 additions and 30 deletions

View File

@@ -69,6 +69,7 @@ format_last_used_summary() {
# Scan applications and collect information
scan_applications() {
debug_log "scan_applications: Starting application scan"
# Simplified cache: only check timestamp (24h TTL)
local cache_dir="$HOME/.cache/mole"
local cache_file="$cache_dir/app_scan_cache"
@@ -82,9 +83,13 @@ scan_applications() {
[[ $cache_age -eq $(date +%s) ]] && cache_age=86401 # Handle missing file
if [[ $cache_age -lt $cache_ttl ]]; then
# Cache hit - return immediately
debug_log "scan_applications: Using cached app list (age: ${cache_age}s)"
echo "$cache_file"
return 0
fi
debug_log "scan_applications: Cache expired (age: ${cache_age}s > ${cache_ttl}s)"
else
debug_log "scan_applications: No cache found, performing fresh scan"
fi
# Cache miss - show scanning feedback below