# Force restart gateway scripts from scripting?

**URL:** <https://forum.inductiveautomation.com/t/force-restart-gateway-scripts-from-scripting/85913>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 19, 2024, 7:40am UTC](https://forum.inductiveautomation.com/t/force-restart-gateway-scripts-from-scripting/85913 "2024-02-19T07:40:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [February 19, 2024, 7:40am UTC](https://forum.inductiveautomation.com/t/force-restart-gateway-scripts-from-scripting/85913/1 "2024-02-19T07:40:58Z")

</div>

Hey all,  
When you save a project the project will automatically restart all of the projects gateway scripts.

We have a use case where we would like to manually trigger this to occur, but I can't find anything relevant in scripting like `system.util....`

Is this a feature we can add?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 19, 2024, 4:09pm UTC](https://forum.inductiveautomation.com/t/force-restart-gateway-scripts-from-scripting/85913/2 "2024-02-19T16:09:01Z")

</div>

This sounds like an XY problem. Why do you want to restart scripts on demand?

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [February 21, 2024, 7:31am UTC](https://forum.inductiveautomation.com/t/force-restart-gateway-scripts-from-scripting/85913/3 "2024-02-21T07:31:07Z")

</div>

We have some gateway scripts where we push some values into varaibles, maybe we can use a more efficient method, but we wanted to prevent constant tag reads, these functions are called fairly often and we'd rather not read the variable each time to reduce time.

I'm imagining if we restart the gateway scripts we can reload this `api_root` and keep it for the entire runtime. Maybe I'm wrong on how this works though.

e.g.:

```auto
#Used as a global value in all of our funtions
api_root = system.tag.readBlocking([x])[0].value

def some_func(...)
    ....

def some_func1(...)
    ....

def some_func2(...)
    ....
```

---

<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:** [February 21, 2024, 12:32pm UTC](https://forum.inductiveautomation.com/t/force-restart-gateway-scripts-from-scripting/85913/4 "2024-02-21T12:32:17Z")

</div>

One of those functions could use the statement `global api_root` to make it writable within that function. Enabling you to update the value without a restart.

I think it is simpler to create a dictionary at the top level and just update various keys within it.
