Skip to content

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Lock cache #472

wants to merge 1 commit into from

Conversation

chaen
Copy link
Contributor

@chaen chaen commented Apr 10, 2025

No description provided.

@chrisburr chrisburr force-pushed the lock_cache branch 2 times, most recently from 0d3c0a4 to e50babe Compare April 10, 2025 23:54
Comment on lines +55 to +71
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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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

Copy link
Contributor Author

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 😆

Copy link
Contributor Author

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

@chrisburr
Copy link
Member

I think this one can be closed right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants