Executing a function if a script crashes in between
<p>I have a script that takes quite a long time to execute. Is there a way to run some code or call a function in case for example the user closes the window while the script is still running? Ideally I would like to run code to set a status as failure in the database.</p>
