Make pylint happy
This commit is contained in:
parent
908a8489f0
commit
37055f923f
|
|
@ -13,12 +13,10 @@
|
|||
# limitations under the License.
|
||||
"""Reference implementation for health checking in gRPC Python."""
|
||||
|
||||
import logging
|
||||
import asyncio
|
||||
import collections
|
||||
|
||||
import grpc
|
||||
from grpc.experimental import aio
|
||||
|
||||
from grpc_health.v1 import health_pb2 as _health_pb2
|
||||
from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
|
||||
|
|
@ -28,14 +26,12 @@ class AsyncHealthServicer(_health_pb2_grpc.HealthServicer):
|
|||
"""An AsyncIO implementation of health checking servicer."""
|
||||
|
||||
def __init__(self):
|
||||
self._lock = asyncio.Lock()
|
||||
self._server_status = dict()
|
||||
self._server_watchers = collections.defaultdict(asyncio.Condition)
|
||||
self._gracefully_shutting_down = False
|
||||
|
||||
async def Check(self, request: _health_pb2.HealthCheckRequest, context):
|
||||
status = self._server_status.get(request.service)
|
||||
logging.debug('Status %s, %s', request.service, status)
|
||||
|
||||
if status is None:
|
||||
await context.abort(grpc.StatusCode.NOT_FOUND)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ from grpc_health.v1 import health_pb2 as _health_pb2
|
|||
from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
|
||||
|
||||
if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
|
||||
from ._async import AsyncHealthServicer
|
||||
# Exposes AsyncHealthServicer as public API.
|
||||
from ._async import AsyncHealthServicer # pylint: disable=unused-import
|
||||
|
||||
SERVICE_NAME = _health_pb2.DESCRIPTOR.services_by_name['Health'].full_name
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue