I have a python function that I call from a custom command with some keywords and options.
This function can take several minutes to complete.
Is there a way to terminate/tell my python function to terminate when I cancel the search it was called from?