diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-10-04 11:24:29 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-10-04 11:39:00 -0700 |
| commit | 18b2384ef9f78ed36fc1ade59cd8b5ff8e256519 (patch) | |
| tree | c319346045eb33f1d22d0af25ec150bac20e6c0b /nijitrack.py | |
| parent | 309662f48584cf8af9a6e73a28ef7f1f630ca1f8 (diff) | |
change check_diff_refresh logic to handle 0 rows in table
Diffstat (limited to 'nijitrack.py')
| -rw-r--r-- | nijitrack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nijitrack.py b/nijitrack.py index 46816f7..d40bc0b 100644 --- a/nijitrack.py +++ b/nijitrack.py @@ -58,10 +58,10 @@ def record_subscriber_data(data: list, force_refresh: bool = False): def check_diff_refresh(): last_updated = server.get_most_recently_added_row_time(DATA_SETTING["TABLE_HISTORICAL"]) - if not last_updated: + if last_updated is None or len(last_updated) == 0 or not last_updated[0]: print("Failed to get the most recently added row time.") return False - last_updated = pytz.timezone('US/Pacific').localize(last_updated) + last_updated = pytz.timezone('US/Pacific').localize(last_updated[0]) utc_now = datetime.now(pytz.timezone('UTC')) pst_now = utc_now.astimezone(pytz.timezone('US/Pacific')) time_diff = pst_now - last_updated |
