Skip to content

Commit

Permalink
rename constant
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-muchiri committed Sep 6, 2024
1 parent c17c751 commit 45ba758
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion onadata/libs/utils/cache_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
ELIST_NUM_ENTITIES_CREATED_AT = f"{ELIST_NUM_ENTITIES_IDS}-created-at"

# Report exception
ELIST_FAILOVER_REPORT = "elist-failover-report-sent"
ELIST_FAILOVER_REPORT_SENT = "elist-failover-report-sent"


def safe_delete(key):
Expand Down
6 changes: 3 additions & 3 deletions onadata/libs/utils/logger_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
ELIST_NUM_ENTITIES_IDS,
ELIST_NUM_ENTITIES_LOCK,
ELIST_NUM_ENTITIES_CREATED_AT,
ELIST_FAILOVER_REPORT,
ELIST_FAILOVER_REPORT_SENT,
safe_delete,
set_cache_with_lock,
)
Expand Down Expand Up @@ -1330,7 +1330,7 @@ def _exec_cached_elist_counter_commit_failover() -> None:
if time_lapse.total_seconds() > failover_timeout:
commit_cached_elist_num_entities()
# Do not send report exception if already sent within the past 24 hrs
if cache.get(ELIST_FAILOVER_REPORT) is None:
if cache.get(ELIST_FAILOVER_REPORT_SENT) is None:
subject = "Periodic task not running"
task_name = (
"onadata.apps.logger.tasks.commit_cached_elist_num_entities_async"
Expand All @@ -1340,4 +1340,4 @@ def _exec_cached_elist_counter_commit_failover() -> None:
"is not configured or has malfunctioned"
)
report_exception(subject, msg)
cache.set(ELIST_FAILOVER_REPORT, "sent", 86400)
cache.set(ELIST_FAILOVER_REPORT_SENT, "sent", 86400)

0 comments on commit 45ba758

Please sign in to comment.