Reputation: 3
In django I am using thread to read xlsx file in the background but after sometimes it breaks down silently without giving any errors. Is there any way to start an independent thread not causing random failure?
thread_obj = threading.Thread(
target=bulk_xlsx_obj.copy_bulk_xlsx
)
thread_obj.start()
Upvotes: 0
Views: 96
Reputation: 788
You could set the thread as Daemon to avoid silent failure as follows:
thread_obj = threading.Thread(
target=bulk_xlsx_obj.copy_bulk_xlsx
)
thread_obj.setDaemon(True)
thread_obj.start()
Upvotes: 1