Public Access
Test : Intégration bouton PayPal Sandbox et activation du Serveur Mail
Build and Push Docker Image / build-and-push (push) Successful in 1m45s
Build and Push Docker Image / build-and-push (push) Successful in 1m45s
This commit is contained in:
1 parent
632c23069a
commit
2ea18701b5
12 files changed
+486
-187
No files matched your search
+7
-13
@@ -2,29 +2,23 @@ import os
|
||||
import json
|
||||
import time
|
||||
|
||||
# FORCAGE DU CHEMIN ABSOLU
|
||||
BASE_DIR = "/DATA/AppData/MULTI-IA-AETHAS38"
|
||||
os.makedirs(BASE_DIR, exist_ok=True)
|
||||
HISTORY_FILE = os.path.join(BASE_DIR, "aethas_history.json")
|
||||
|
||||
def load_history():
|
||||
if not os.path.exists(HISTORY_FILE):
|
||||
with open(HISTORY_FILE, 'w', encoding='utf-8') as f:
|
||||
json.dump({}, f)
|
||||
with open(HISTORY_FILE, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
with open(HISTORY_FILE, 'w', encoding='utf-8') as f: json.dump({}, f)
|
||||
with open(HISTORY_FILE, 'r', encoding='utf-8') as f: return json.load(f)
|
||||
|
||||
def save_history(history):
|
||||
with open(HISTORY_FILE, 'w', encoding='utf-8') as f:
|
||||
json.dump(history, f, indent=4)
|
||||
with open(HISTORY_FILE, 'w', encoding='utf-8') as f: json.dump(history, f, indent=4)
|
||||
|
||||
def nettoyer_vieilles_discussions():
|
||||
history = load_history()
|
||||
now = time.time()
|
||||
un_an_en_secondes = 365 * 24 * 60 * 60
|
||||
a_supprimer = [cid for cid, data in history.items() if not data.get('pinned', False) and now - data.get('timestamp', now) > un_an_en_secondes]
|
||||
un_an = 365 * 24 * 60 * 60
|
||||
a_supprimer = [cid for cid, data in history.items() if not data.get('pinned', False) and now - data.get('timestamp', now) > un_an]
|
||||
if a_supprimer:
|
||||
for cid in a_supprimer:
|
||||
del history[cid]
|
||||
save_history(history)
|
||||
print(f"🧹 AETHAS CORE : Nettoyage auto terminé. {len(a_supprimer)} discussion(s) supprimée(s).")
|
||||
for cid in a_supprimer: del history[cid]
|
||||
save_history(history)
|
||||
Reference in new issue
Block a user