Commit 242db439 authored by Klaus-Uwe Mitterer's avatar Klaus-Uwe Mitterer

Make sure to close browser

parent ce1fec74
......@@ -136,13 +136,15 @@ if __name__ == "__main__":
db = dbtools.dbHelper()
driver = webdriver.Firefox()
ret = {"rec": 0,"snt": 0}
if loginHandler(driver):
p = multiprocessing.Process(target=mainHandler, args=([ret]))
p.start()
p.join(1500)
if p.is_alive():
p.terminate()
p.join()
driver.close()
print("Received", ret["rec"], "messages")
print("Sent", ret["snt"], "messages")
try:
if loginHandler(driver):
p = multiprocessing.Process(target=mainHandler, args=([ret]))
p.start()
p.join(1500)
if p.is_alive():
p.terminate()
p.join()
finally:
driver.close()
print("Received", ret["rec"], "messages")
print("Sent", ret["snt"], "messages")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment