blueprint function

This commit is contained in:
2026-05-02 00:08:43 +03:00
parent 05785c294e
commit 5f6855ec69
9 changed files with 295 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ import json
from datetime import datetime, timedelta
import os
from flask import make_response
from blueprint_engine import evaluate_blueprints
api = Blueprint('api', __name__)
@@ -94,6 +95,13 @@ def receive_state():
datetime.utcnow().isoformat()
))
conn.commit()
try:
evaluate_blueprints(conn)
conn.commit()
except Exception as e:
print("Error evaluating blueprints:", e)
conn.close()
return jsonify({'ok': True, 'towns_updated': len(towns)})