From 74aa134971d99b9eba34015b31e1763bb2a78763 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 29 Oct 2022 17:43:14 +0700 Subject: [PATCH] fix next_exec epoch time builder --- tubearchivist/home/src/es/snapshot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tubearchivist/home/src/es/snapshot.py b/tubearchivist/home/src/es/snapshot.py index d9b607b9..35ce12c2 100644 --- a/tubearchivist/home/src/es/snapshot.py +++ b/tubearchivist/home/src/es/snapshot.py @@ -205,12 +205,12 @@ class ElasticSnapshot: if not policy: return False - next_exec = policy["next_execution_millis"] - next_exec_date = datetime.fromtimestamp(next_exec // 1000) + next_exec = policy["next_execution_millis"] // 1000 + next_exec_date = datetime.fromtimestamp(next_exec) next_exec_str = next_exec_date.strftime("%Y-%m-%d %H:%M") expire_after = policy["policy"]["retention"]["expire_after"] policy_metadata = { - "next_exec": next_exec_date, + "next_exec": next_exec, "next_exec_str": next_exec_str, "expire_after": expire_after, }