# Gateway timer scripts not running

**URL:** <https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896>\
**Category:** Ignition\
**Created:** [July 19, 2018, 2:10pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896 "2018-07-19T14:10:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myllka](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myllka/32/4140_2.png) [@Myllka](https://forum.inductiveautomation.com/u/Myllka)\
**Post date:** [July 19, 2018, 2:10pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/1 "2018-07-19T14:10:48Z")

</div>

Hi,

I’ve some troubles with my gateway timer scripts.  
First of all, they all are in fixed rate and dedicated, with a delay from 1s to 10mn.  
Sometime, they freeze in a strange way: in my browser on the status page for gateway scripts, everything seems fine, but in reality they are not executed (I have input/output counters for every single one). There is no error in logs.  
I noticed it happens more often when one script used to synchronize databases, a pretty huge sql stored procedure which take between 10s to 45s for a delay of 2mn, is enable.  
Something else: there is another project with its own scripts (fixed rate/dedicated too) and they still running normally while mine are freezing.  
I executed every script in the script console to check errors, but everything seems clear.  
I’m using 7.9.8.

An idea about what’s happening ?

Thanks.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [November 22, 2018, 8:40pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/2 "2018-11-22T20:40:55Z")

</div>

I have also just experienced this issue as well. Client is understandably annoyed that certain actions have not completed, that are supposed to happen every hour.

---

<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:** [November 23, 2018, 1:34am UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/3 "2018-11-23T01:34:11Z")

</div>

Each and every timer script, no matter what it’s interval settings, will not execute again while a previous invocation is still running. Anything you do in your timer scripts that cannot always be executed within the event period must be sent to an asynchronous thread, unless the non-overlapping condition is desirable. Consider having each troublesome event log on start and again on finish so it is obvious how log it is taking, and a missing finish will tell you that something is getting stuck. I’ve yet to see one of these situations _ **not** _ be programmer error.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [January 30, 2019, 10:32pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/4 "2019-01-30T22:32:41Z")

</div>

My issue turned out to be the script was hanging, which caused the Gateway timed task to hang, and not be able to execute again, as pturmel was saying.  
Once i fixed the underlying issue with the script hanging, i had no more problems with Gateway timer scripts running regularly.

---

<div class="post-metadata">

**Author:** ![aravindan.s](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@aravindan.s](https://forum.inductiveautomation.com/u/aravindan.s)\
**Post date:** [September 7, 2020, 1:54pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/5 "2020-09-07T13:54:13Z")

</div>

Is it a better option to use timeout function like python “Signal” library function to raise exception and come out of the particular hanging thread ??? so that timer script does not hang forever ?

Is this method safe? Please suggest

---

<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:** [September 7, 2020, 4:18pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/6 "2020-09-07T16:18:31Z")

</div>

Not sure it would work. Jython threads are really java threads. They don't like to be externally killed. They have an interrupt feature that could be used (and I recommend), but that requires the thread to regularly check its own .interupted() status. See the related advice in this topic:

> [@Managing multiple asynchronous threads](http://forum.inductiveautomation.com/t/managing-multiple-asynchronous-threads/37185):
>
> I've followed this post for monitoring a directory for file changes and I think I have created more than one watch service in different threads. How do I monitor, manage, and delete these threads?

---

<div class="post-metadata">

**Author:** ![davi.soares](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@davi.soares](https://forum.inductiveautomation.com/u/davi.soares)\
**Post date:** [May 11, 2026, 3:04pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-scripts-not-running/18896/7 "2026-05-11T15:04:56Z")

</div>

I had an issue with this.

My script wasn't updated when I edited it and then clicked "Apply" and saved. It only works when I click "OK".
