# \[ SOLVED \]Ignition as freezing for few minutes

**URL:** <https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [March 22, 2023, 4:09pm UTC](https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442 "2023-03-22T16:09:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [March 22, 2023, 4:09pm UTC](https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442/1 "2023-03-22T16:09:25Z")

</div>

Hi, Does anyone know why this happen?, I sounds like was lost but I don't know why and I could not did anything with the application in that time, the photo is from the app running and then just stop working like freezing.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/cc2a62477753df72657e93006e1db3cac0dc791d.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:** [March 22, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442/2 "2023-03-22T16:58:18Z")

</div>

That usually means you have a script running in the foreground thread that is taking seconds or more to run. Pretty much all scripting in Vision (events) originates on the UI (foreground) thread and must execute quickly to not block the user interface. Any time-consuming script must be delegated to a background thread to avoid this problem. (Using `system.util.invokeAsynchronous()`.)

This commonly caused by calling functions that need to have the gateway do some work to obtain a result. Alarm status lookup and DB queries are worst offenders.

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [March 22, 2023, 5:21pm UTC](https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442/3 "2023-03-22T17:21:10Z")

</div>

So, I am using system.util.invokeAsynchronous(), but how can I resolved?

---

<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:** [March 22, 2023, 5:28pm UTC](https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442/4 "2023-03-22T17:28:49Z")

</div>

Resolution requires implementing background operations or proper use of asynchronous bindings everywhere necessary in your code. That is not practical to figure out through the forum, though posting an export of your project might get someone to look at it. It probably is too much to ask of support, but that is your best bet.

Ignition scripting is very powerful, but that power makes it very easy to screw up, too. Your symptoms suggest inappropriate use of scripts that take a long time, or variable long time, to execute.

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [March 22, 2023, 5:33pm UTC](https://forum.inductiveautomation.com/t/solved-ignition-as-freezing-for-few-minutes/71442/5 "2023-03-22T17:33:52Z")

</div>

Thank you so much
