Upload deploy/ingest/run.py with huggingface_hub
Browse files110 unmodified lines111112113114115116117118119120121122123124125126127128129130131132133134110 unmodified lines except Exception as e: # noqa: BLE001 report["errors"].append("satellites: " + repr(e)[:150])
# GDACS 灾害预警 / FIRMS 火点:按各自鲜度刷新,失败不影响主流程 here = os.path.dirname(os.path.abspath(__file__)) for name, script, out, hours, tmo in ( ("gdacs", "gdacs.py", "disasters.json", 0.5, 120), ("firms", "firms.py", "fires.json", 1.0, 200)): path = os.path.normpath(os.path.join(here, "..", "globe", "data", out)) try: if os.path.exists(path) and (time.time() - os.path.getmtime(path)) < hours * 3600: report[name] = "fresh, skipped" continue r = subprocess.run([sys.executable, os.path.join(here, script)], capture_output=True, text=True, timeout=tmo) report[name] = (r.stdout or "").strip()[:200] if r.returncode != 0: report["errors"].append(name + ": " + (r.stderr or "")[-160:]) except Exception as e: # noqa: BLE001 report["errors"].append(name + ": " + repr(e)[:120])
report["summary"] = {"total": summary["total_events"], "today": summary["today_events"], "countries": summary["countries"]}deploy/ingest/run.py+18