-
Notifications
You must be signed in to change notification settings - Fork 25
Lock cache #472
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
base: main
Are you sure you want to change the base?
Lock cache #472
Conversation
0d3c0a4
to
e50babe
Compare
enable_otel = False | ||
try: | ||
import socket | ||
|
||
name = socket.gethostname() | ||
|
||
for c in name[::-1]: | ||
try: | ||
enable_otel = bool(int(c) % 2) | ||
break | ||
except ValueError: | ||
pass | ||
except Exception as exe: | ||
logger.exception(exe) | ||
|
||
logger.info(f"Randomly enabling OTEL {enable_otel=}") | ||
return enable_otel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable_otel = False | |
try: | |
import socket | |
name = socket.gethostname() | |
for c in name[::-1]: | |
try: | |
enable_otel = bool(int(c) % 2) | |
break | |
except ValueError: | |
pass | |
except Exception as exe: | |
logger.exception(exe) | |
logger.info(f"Randomly enabling OTEL {enable_otel=}") | |
return enable_otel | |
enable_otel = bool(int(next(filter(str.isdigit, socket.gethostname() + "0"))) % 2) | |
logger.info(f"Randomly enabling OTEL {enable_otel=}") | |
return enable_otel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a hell lot less readable 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and it doesn't go backward
I think this one can be closed right? |
No description provided.