Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def serve(port):
corpus_path = '/tmp/allCountries.filtered.txt'
server = grpc.server(futures.ThreadPoolExecutor(max_workers=20))
add_GeoExtractServicer_to_server(GeoExtractServicer(corpus_path), server)
server.add_insecure_port(port)
server.start()
log.info("Server started: %s", port)
try:
while True:
time.sleep(84600)
except KeyboardInterrupt:
server.stop(60)