diff --git a/drone.py b/drone.py index f58e402..2f8370f 100644 --- a/drone.py +++ b/drone.py @@ -7,6 +7,7 @@ def run(): p = Process(target=drone_poller.run) p.start() client.run() + p.join() if __name__ == '__main__': diff --git a/drone_poller.py b/drone_poller.py index 433dccf..4267dc4 100644 --- a/drone_poller.py +++ b/drone_poller.py @@ -59,24 +59,20 @@ def poll_website(): def run(): while True: try: - try: - # send my own data - notify_website() - except: - print('[x] Could not notify the website') - print("Unexpected error:", sys.exc_info()[0]) + # send my own data + notify_website() + except: + print('[x] Could not notify the website') + print("Unexpected error:", sys.exc_info()[0]) - try: - # receive new bookings - poll_website() - except : - print('[x] Could not fetch bookings from the website') - print("Unexpected error:", sys.exc_info()[0]) + try: + # receive new bookings + poll_website() + except : + print('[x] Could not fetch bookings from the website') + print("Unexpected error:", sys.exc_info()[0]) - time.sleep(settings.WEBSITE_POLLING_SLEEP) - except KeyboardInterrupt: - print('Program execution stopped by user') - exit() + time.sleep(settings.WEBSITE_POLLING_SLEEP) if __name__ == '__main__':