Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(flags): add debug log for healthcheck failure error #27810

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions posthog/database_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def is_postgres_connected_check(self) -> bool:
with connections[DATABASE_FOR_FLAG_MATCHING].cursor() as cursor:
cursor.execute("SELECT 1")
return True
except Exception:
logger.exception("postgres_connection_failure")
except Exception as e:
logger.exception(f"postgres_connection_failure - {e}")
return False


Expand Down
1 change: 1 addition & 0 deletions posthog/models/feature_flag/flag_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ def get_all_feature_flags(
# check every 10 seconds whether the database is alive or not
is_database_alive = (not settings.DECIDE_SKIP_POSTGRES_FLAGS) and postgres_healthcheck.is_connected()
if not is_database_alive or not flags_have_experience_continuity_enabled:
logger.debug(f"setting skip_database_flags to {not is_database_alive}")
return _get_all_feature_flags(
all_feature_flags,
team_id,
Expand Down
Loading