Need to fix and optimize python code

Job ID: 31115647

Budget: ₹400 – ₹750 INR

There is a python script which is using elasticsearch and facebook marketing api. In the last step of script, it updates an elasticsearch index, but sometimes it freezes in ubuntu. Tried giving delays, optimizing threads etc but no success.

More info here: https://stackoverflow.com/questions/68485450/how-to-prevent-python-script-from-freezing-in-ubuntu-16-04

Need a python expert urgently who has actually worked on these two techs.