Fix
Signed-off-by: Thomas Williams <thomas@ycwmwl.cymru>
This commit is contained in:
parent
847fbdbd0a
commit
cc0a27ff10
1 changed files with 13 additions and 9 deletions
|
@ -55,18 +55,22 @@ def main():
|
|||
if dataBuffer:
|
||||
|
||||
data = dataBuffer.pop(0)
|
||||
|
||||
if config.loggingMode == 'rabbitmq':
|
||||
|
||||
rabbitmq.publish(f"{data}")
|
||||
rabbitmq.publish(f"{data}")
|
||||
|
||||
else:
|
||||
|
||||
hostname = socket.gethostname()
|
||||
ipAddress = socket.gethostbyname(hostname)
|
||||
data = data.split('|')
|
||||
manager = log.logsManager(config.sqlServer, config.sqlDatabase, config.sqlUsername, config.sqlPassword)
|
||||
manager.insertIPBlock(hostname, ipAddress, data[1], data[5], data[6], data[2], config.ipinfoAPIToken)
|
||||
while not (stopEvent.is_set() and not failureEvent.is_set()):
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
if dataBuffer:
|
||||
|
||||
data = dataBuffer.pop(0)
|
||||
hostname = socket.gethostname()
|
||||
ipAddress = socket.gethostbyname(hostname)
|
||||
data = data.split('|')
|
||||
manager = log.logsManager(config.sqlServer, config.sqlDatabase, config.sqlUsername, config.sqlPassword)
|
||||
manager.insertIPBlock(hostname, ipAddress, data[1], data[5], data[6], data[2], config.ipinfoAPIToken)
|
||||
|
||||
except Exception:
|
||||
failureEvent.set()
|
||||
|
|
Loading…
Reference in a new issue