Skip to content

Instantly share code, notes, and snippets.

@aeharvlee
Created April 21, 2020 13:39
Show Gist options
  • Save aeharvlee/d08f58137153f75b301df2e2c3c41185 to your computer and use it in GitHub Desktop.
Save aeharvlee/d08f58137153f75b301df2e2c3c41185 to your computer and use it in GitHub Desktop.
class BlackIPv4Servicer(biv4_pb2_grpc.BlackIPv4ServiceServicer):
def __init__(self):
self.cnxpool = repository.get_connection_pool()
def GetReputationByIPv4(self, request, context):
try:
cnx = self.cnxpool.get_connection()
reputation = repository.get_reputation_by_ipv4(cnx, request)
return reputation
except Exception as e:
logging.error(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment