mirror of
https://github.com/tw93/Mole.git
synced 2026-02-11 05:59:16 +00:00
Support debug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user