Development

This commit is contained in:
Matthew Grotke 2026-05-26 00:28:04 -04:00
parent 20befb920c
commit fa8a5c1b45
2 changed files with 48 additions and 15 deletions

View file

@ -166,6 +166,40 @@ def get_dashboard_done():
return items
def get_done_timestamps():
"""Return dict of {uuid: applied_ts} from .dashboard-done."""
result = {}
try:
for line in open(DASHBOARD_DONE).read().splitlines():
if not line.strip():
continue
parts = line.split(None, 1)
if len(parts) >= 2:
result[parts[0]] = int(parts[1])
elif len(parts) == 1:
result[parts[0]] = None
except Exception:
pass
return result
def load_all_snapshots():
"""Return all snapshot dicts from .snapshots/, sorted newest first."""
snaps = []
try:
for fname in sorted(os.listdir(SNAPSHOTS_DIR), reverse=True):
if not fname.endswith('.json'):
continue
try:
with open(os.path.join(SNAPSHOTS_DIR, fname)) as f:
snaps.append(json.load(f))
except Exception:
pass
except Exception:
pass
return snaps
def flush_pending_to_queue():
"""Move all entries from .dashboard-pending to .dashboard-queue and clear pending."""
items = _read_dashboard_pending()