Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Conversation

bnellnm
Copy link
Member

@bnellnm bnellnm commented Apr 5, 2023

analytics_disabled() was always doing the country check before checking the NM_DISABLE_ANALYTICS env variable, e.g.

2023-04-04 22:00:19,003 [MainThread  ] [INFO ]  Requested http://ipinfo.io/199.217.107.238/json
2023-04-04 22:00:19,397 [MainThread  ] [INFO ]  Requested http://ipinfo.io/199.217.107.238/json

This checks the env variable before checking the country.

env_disabled = os.getenv("NM_DISABLE_ANALYTICS")

return gdpr or env_disabled
return env_disabled or is_gdpr_country()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the original check made sense too, the idea being we always disable analytics for a gdpr country and optionally for others if NM_DEBUG_ANALYTICS is set but am not opposed to this change.

Also removing the variable makes the expression read better, thank you for that!

@bnellnm bnellnm merged commit b060d3e into main Apr 5, 2023
@bnellnm bnellnm deleted the early-exit branch April 5, 2023 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants