INNER CODE UNIT · Python

main

xiaoxiaolulu/EasyPost · unit-executor/main.py:29

async def main():
    ip, port = get_ip_port()
    server = grpc.aio.server()
    server = grpc.aio.server(interceptors=[ExecutorInterceptor()])
    executor_pb2_grpc.add_ExecutorServiceServicer_to_server(ApiRunServer(), server)
    server.add_insecure_port(f"{ip}:{port}")

    service_id = str(uuid.uuid1())

    consul = ConsulRegister(settings.CONSUL_HOST, settings.CONSUL_PORT)
    if not consul.register_consul(
            name=settings.SERVICE_NAME,
            service_id=service_id,
            address=ip,
            port=port,
            tags=settings.SERVICE_TAGS
    ):
        logger.info(f"{settings.SERVICE_NAME} 服务注册失败")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…