Nexo-S commited on
Commit
38b7d8f
·
verified ·
1 Parent(s): 0eccbfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -1034,6 +1034,13 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as iface:
1034
  iface.load(get_bot_skills, outputs=skills_table)
1035
 
1036
 
 
 
 
 
 
 
 
1037
  import threading
1038
  _auto_pilot_started = False
1039
  def run_auto_pilot():
@@ -1047,23 +1054,12 @@ def run_auto_pilot():
1047
  asyncio.set_event_loop(loop)
1048
  loop.create_task(universal_scanner_loop())
1049
  loop.create_task(dream_simulation_loop())
1050
- loop.create_task(hf_backup_loop()) # ⬅️ LA TACHE DE SAUVEGARDE EST BRANCHÉE ICI
1051
  loop.run_forever()
1052
  except Exception as e: print(f"⚠️ Erreur Auto-Pilote : {e}")
1053
 
1054
  if __name__ == "__main__":
1055
  try: threading.Thread(target=run_auto_pilot, daemon=True).start()
1056
  except Exception as e: print(f"⚠️ Erreur Thread : {e}")
1057
- iface.launch(server_name="0.0.0.0", server_port=7860, show_api=True)
1058
-
1059
- # --- ☁️ SAUVEGARDE CLOUD SILENCIEUSE ---
1060
- async def hf_backup_loop():
1061
- while True:
1062
- await asyncio.sleep(1800) # Attendre 30 minutes (1800 secondes)
1063
- print("☁️ [SYSTEM] Lancement du backup planifié...")
1064
- backup_db_to_hf()
1065
-
1066
- if __name__ == "__main__":
1067
- try: threading.Thread(target=run_auto_pilot, daemon=True).start()
1068
- except Exception as e: print(f"⚠️ Erreur Thread : {e}")
1069
  iface.launch(server_name="0.0.0.0", server_port=7860, show_api=True)
 
1034
  iface.load(get_bot_skills, outputs=skills_table)
1035
 
1036
 
1037
+ # --- ☁️ SAUVEGARDE CLOUD SILENCIEUSE ---
1038
+ async def hf_backup_loop():
1039
+ while True:
1040
+ await asyncio.sleep(1800) # Attendre 30 minutes (1800 secondes)
1041
+ print("☁️ [SYSTEM] Lancement du backup planifié...")
1042
+ backup_db_to_hf()
1043
+
1044
  import threading
1045
  _auto_pilot_started = False
1046
  def run_auto_pilot():
 
1054
  asyncio.set_event_loop(loop)
1055
  loop.create_task(universal_scanner_loop())
1056
  loop.create_task(dream_simulation_loop())
1057
+ loop.create_task(hf_backup_loop()) # ⬅️ LA SAUVEGARDE EST BIEN ICI
1058
  loop.run_forever()
1059
  except Exception as e: print(f"⚠️ Erreur Auto-Pilote : {e}")
1060
 
1061
  if __name__ == "__main__":
1062
  try: threading.Thread(target=run_auto_pilot, daemon=True).start()
1063
  except Exception as e: print(f"⚠️ Erreur Thread : {e}")
1064
+ # 🛑 LE LAUNCH DOIT TOUJOURS ÊTRE LA TOUTE DERNIÈRE LIGNE DU FICHIER !
 
 
 
 
 
 
 
 
 
 
 
1065
  iface.launch(server_name="0.0.0.0", server_port=7860, show_api=True)