# How to get "GatewayContext" in Gateway Event (timer) script

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-gatewaycontext-in-gateway-event-timer-script/24668>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [May 5, 2019, 8:51pm UTC](https://forum.inductiveautomation.com/t/how-to-get-gatewaycontext-in-gateway-event-timer-script/24668 "2019-05-05T20:51:05Z")\
**Posts on this page:** 1\
**Showing post:** 14

<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:** [May 17, 2019, 11:56am UTC](https://forum.inductiveautomation.com/t/how-to-get-gatewaycontext-in-gateway-event-timer-script/24668/14 "2019-05-17T11:56:59Z")

</div>

I sure hope you are keeping track of these (this?) listeners with the system.util.getGlobals() dictionary -- otherwise you will be attaching code to platform objects that will survive code edits and will leak jython interpreters along the way. See this discussion:

> [@\[REQUEST\] Persistence of an object instance after Scripting Save](http://forum.inductiveautomation.com/t/request-persistence-of-an-object-instance-after-scripting-save/23641/4):
>
> In order to pick up new/changed jython code in importable script modules, Ignition must start a new interpreter with scopes for each project and for the global scripting project. The first call into a script module after interpreter startup imports it, creating all top-level named objects in the script module (functions, classes, and module-scope variables). All jython objects referenced solely by the old interpreters are garbage collected with the interpreter. Any old jython objects (code or…

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-get-gatewaycontext-in-gateway-event-timer-script/24668)._
