Skip to content

Commit

Permalink
Comment cleanup (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
UTXOnly committed Jul 6, 2024
1 parent d9ef88b commit fd01d08
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 12 deletions.
Empty file.
3 changes: 0 additions & 3 deletions docker_stuff/python_stuff/event_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,16 @@ async def _sanitize_event_keys(self, filters, logger) -> Dict:
updated_keys = {}
limit = ""
global_search = {}
# filters_wo_search_limit = filters
try:
try:
limit = filters.get("limit", 100)
filters.pop("limit")
# filters.pop("limit")
except Exception as exc:
logger.error(f"Exception is: {exc}")

try:
global_search = filters.get("search", {})
filters.pop("search")
# filters.pop("search")
except Exception as exc:
logger.error(f"Exception is: {exc}")

Expand Down
6 changes: 0 additions & 6 deletions docker_stuff/python_stuff/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@

from event_classes import Event, Subscription

# Initialize the logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger.addHandler(handler)

# from otel_metrics import PythonOTEL

app = FastAPI()

trace.set_tracer_provider(
Expand All @@ -43,7 +40,6 @@
span_processor = BatchSpanProcessor(otlp_exporter)
otlp_tracer = trace.get_tracer_provider().add_span_processor(span_processor)

# py_otel = PythonOTEL()

# Set up a separate tracer provider for Redis
redis_tracer_provider = TracerProvider(
Expand Down Expand Up @@ -231,7 +227,6 @@ async def handle_subscription(request: Request) -> JSONResponse:
try:
request_payload = await request.json()
subscription_obj = Subscription(request_payload)
# py_otel.counter_query.add(1, py_otel.labels)

if not subscription_obj.filters:
return subscription_obj.sub_response_builder(
Expand Down Expand Up @@ -286,7 +281,6 @@ async def handle_subscription(request: Request) -> JSONResponse:
"EOSE", subscription_obj.subscription_id, "", 500
)


if __name__ == "__main__":
logger.info(f"Write conn string is: {get_conn_str('WRITE')}")
logger.info(f"Read conn string is: {get_conn_str('READ')}")
Expand Down
2 changes: 1 addition & 1 deletion docker_stuff/python_stuff/websocket_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def __init__(self, message: List[Union[str, Dict[str, Any]]], websocket, logger)
merged.update(item)
logger.debug(f"merged is {merged} and type {type(merged)}")
self.event_payload = (
merged # {json.loads(item) for item in range(2, len(message))}
merged
)
else:
self.event_payload: Dict[str, Any] = message[1]
Expand Down
2 changes: 0 additions & 2 deletions docker_stuff/python_stuff/websocket_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

AioHttpClientInstrumentor().instrument()

# trace.set_tracer_provider(TracerProvider())
trace.set_tracer_provider(
TracerProvider(resource=Resource.create({"service.name": "websocket_handler_otel"}))
)
Expand Down Expand Up @@ -107,7 +106,6 @@ async def handle_websocket_connection(
"send_event_to_subscription"
) as span:
current_span = trace.get_current_span()
# current_span.set_attribute("service.name", "websocket_handler")
current_span.set_attribute(
"operation.name", "send.event.subscription"
)
Expand Down

0 comments on commit fd01d08

Please sign in to comment.