Basically, I'm running a reindexing function, and immediately after that, I'm running a function to delete the source index. Python runs all lines of code for the first function and moves to the next function (delete index).
Sometimes the reindexing isn't performed and the source index gets deleted, causing data loss.
I want to add either a Boolean field or any sort of flag that indicates that reindexing has been completed so that I can move on with the delete function.