# Global project Gateway Timer Script firing way too often

**URL:** <https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 23, 2022, 5:47pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550 "2022-03-23T17:47:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.d.white](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@richard.d.white](https://forum.inductiveautomation.com/u/richard.d.white)\
**Post date:** [March 23, 2022, 5:47pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/1 "2022-03-23T17:47:12Z")

</div>

I want to use a timer-based gateway event script and have it fire every 10 seconds. I’ve put this script on the global project. What I’m finding is that it does pause but then rapidly counts up, at a rate much more frequently than I need, then pauses again. Can someone explain this behavior and how to correct it? Please see the screenshot of a super-basic tag writing script I used later for troubleshooting (same behavior). Thank you

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/9/39921fb430bda0c920d7b28afe65cda8766b1707.png)

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [March 23, 2022, 5:51pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/2 "2022-03-23T17:51:47Z")

</div>

Have you tried setting Delay Type to “Fixed Rate”?

---

<div class="post-metadata">

**Author:** ![richard.d.white](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@richard.d.white](https://forum.inductiveautomation.com/u/richard.d.white)\
**Post date:** [March 23, 2022, 5:55pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/3 "2022-03-23T17:55:23Z")

</div>

Yes! I actually just adjusted the script, to check this and it’s behaving the same… Pause followed by a rapid increase in the counter. Its almost like the script is queing up multiple times then firing all at once.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 23, 2022, 5:56pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/4 "2022-03-23T17:56:39Z")

</div>

I don't see an option for Scheduled which tells me you are on a version Prior to 8.1.6, what version are you on. I believe there was a bug at one point where the timer scripts didn't behave exactly as expected, but I could be misremembering that.

Also, I see that you have the Shared Threading option selected and there is another Timer script configured. Is it possible that other timer is somehow blocking this one? From the manual:

> - The **Shared** setting means that all timer scripts will share a thread. This is usually desirable, as it prevents creating lots of unnecessary threads: threads have some overhead, so a small amount of resources are used per thread. **However, if your script takes a long time to run, it will block other timer tasks on the shared thread.**

Also, you may want to consider using `system.tag.writeAsync()` instead of the blocking version depending on the actual script that you are wanting to use.

---

<div class="post-metadata">

**Author:** ![richard.d.white](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@richard.d.white](https://forum.inductiveautomation.com/u/richard.d.white)\
**Post date:** [March 23, 2022, 6:03pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/5 "2022-03-23T18:03:06Z")

</div>

Thank you Lrose - you’ve given me some homework… I’ll reply back in a bit with what I find.

---

<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 23, 2022, 6:33pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/6 "2022-03-23T18:33:03Z")

</div>

What do you mean by “global” project? The inheritable project from a v7.9 conversion? If so, don’t put it there. Inheritable projects don’t run events themselves. But every project that inherits the events will run its own “copy”. Make a new project, inheriting from global if necessary.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [March 23, 2022, 6:35pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/7 "2022-03-23T18:35:56Z")

</div>

[This page in the manual](https://docs.inductiveautomation.com/display/DOC81/Project+Inheritance) has an excerpt about what @pturmel is referring to. It’s under Inheritance and “Runnable” Resources.

---

<div class="post-metadata">

**Author:** ![richard.d.white](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@richard.d.white](https://forum.inductiveautomation.com/u/richard.d.white)\
**Post date:** [March 24, 2022, 5:26pm UTC](https://forum.inductiveautomation.com/t/global-project-gateway-timer-script-firing-way-too-often/57550/8 "2022-03-24T17:26:24Z")

</div>

Thank you for your updates. Moving the script to my active project was the solution. It now makes sense… I do have many individual projects so it follows that each one of those would have been executing the same global script multiple times, resulting in the behavior I observed. Thanks!!!
