Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Return HTTP ok on /v2/health #1

Merged
merged 1 commit into from Jun 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions funcx_ws/server.py
Expand Up @@ -4,6 +4,7 @@
import websockets
import aioredis
import aio_pika
import http
from funcx_ws.auth import AuthClient
from funcx.serialize import FuncXSerializer

Expand All @@ -19,6 +20,7 @@ def __init__(self, redis_host, redis_port, rabbitmq_host, web_service_uri):
self.redis_port = redis_port
self.rabbitmq_host = rabbitmq_host
self.funcx_service_address = f'{web_service_uri}/v2'
logger.info(f"funcx_service_address : {self.funcx_service_address}")
# self.funcx_service_address = 'https://api.funcx.org/v1'
self.auth_client = AuthClient(self.funcx_service_address)

Expand Down Expand Up @@ -148,4 +150,6 @@ async def handle_connection(self, ws, path):
task.cancel()

async def process_request(self, path, headers):
if path == '/v2/health':
return http.HTTPStatus.OK, [], b"OK\n"
return await self.auth_client.authenticate(headers)