From 05e5a83c918c124a36ac0075c78ecada07598920 Mon Sep 17 00:00:00 2001 From: tiksan Date: Tue, 14 Nov 2023 21:16:21 -0800 Subject: [PATCH] Inline with origin/master --- estimate/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/estimate/__init__.py b/estimate/__init__.py index f454c031..f9d8dfc9 100644 --- a/estimate/__init__.py +++ b/estimate/__init__.py @@ -59,10 +59,9 @@ def estimate_user(user_tid: int, api_key: str) -> typing.Tuple[int, int]: try: update_user(tid=user_tid, key=api_key, refresh_existing=True) + update_error = False except Exception: update_error = True - finally: - update_error = False ps = PersonalStatModel.objects(tid=user_tid).order_by("-timestamp").first() @@ -79,4 +78,4 @@ def estimate_user(user_tid: int, api_key: str) -> typing.Tuple[int, int]: df["tid"][0] = user_tid df = df.astype("int64") - return model.predict("int64"), int(time.time()) - ps.timestamp + 604_800 + return model.predict(df), int(time.time()) - ps.timestamp + 604_800