# Way to stop script-invoke-async thread

**URL:** <https://forum.inductiveautomation.com/t/way-to-stop-script-invoke-async-thread/61157>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [June 24, 2022, 1:24pm UTC](https://forum.inductiveautomation.com/t/way-to-stop-script-invoke-async-thread/61157 "2022-06-24T13:24:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jacob\_Sanchez](https://forum.inductiveautomation.com/u/Jacob_Sanchez)\
**Post date:** [June 24, 2022, 1:24pm UTC](https://forum.inductiveautomation.com/t/way-to-stop-script-invoke-async-thread/61157/1 "2022-06-24T13:24:15Z")

</div>

After some careless scripting i found that i have ended up with 3 threads trying to do the same thing and i cannot figure out how to stop them (short of restarting the gateway).

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/beb44cf737f9b9e7155221d16b375856c9504501.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 24, 2022, 2:17pm UTC](https://forum.inductiveautomation.com/t/way-to-stop-script-invoke-async-thread/61157/2 "2022-06-24T14:17:16Z")

</div>

It isn’t safe to kill threads. Threads can and should be designed to be interruptible (checking for interrupt status and/or exceptions for graceful exit). If you didn’t do that, `interrupt()` may not work. If not, you will have to restart the gateway.

Search this forum for topics related to persistent thread and long-lived background tasks.
