diff --git a/pg-query/handler.py b/pg-query/handler.py index 8007e2a..b0a5835 100644 --- a/pg-query/handler.py +++ b/pg-query/handler.py @@ -24,15 +24,15 @@ def handle(event): conn = psycopg2.connect(dsn) try: cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) - cur.execute("SELECT id, namespace, function_name, status, started_at FROM invocations ORDER BY started_at DESC LIMIT %s", (limit,)) + cur.execute("SELECT id, namespace, function_name, status, created_at FROM invocations ORDER BY created_at DESC LIMIT %s", (limit,)) rows = cur.fetchall() # RealDictCursor возвращает объекты, сериализуем вручную result = [] for row in rows: r = dict(row) # datetime → str - if r.get("started_at"): - r["started_at"] = str(r["started_at"]) + if r.get("created_at"): + r["created_at"] = str(r["created_at"]) result.append(r) return {"invocations": result, "count": len(result)} finally: diff --git a/pg-query/main.tf b/pg-query/main.tf index a545b2f..7c5408c 100644 --- a/pg-query/main.tf +++ b/pg-query/main.tf @@ -16,7 +16,7 @@ terraform { required_providers { sless = { source = "terra.k8c.ru/naeel/sless" - version = "~> 0.1" + version = "~> 0.1.1" } } }