Can I use System Tag in Gateway event script

Hello, I was wondering if I its possible to use system tag (current username logged into OS) in this Gateway event script and how. Thanks

There is a system tag for a client OS user, but not Gateway so far as I can see.

Also, the general consensus is to avoid any time.sleep in any scripts.

1 Like

No, the gateway runs separately. It does not have client-specific tags.

1 Like

thanks, but is there any other option to put there username of the machine ? E.g. I am using vpn to connect to ignition gw and as you can see on project update git commit should be executed. We want to put there username to commit message

import os
import pwd
values = pwd.getpwuid(os.getuid())[0]
print values
system.tag.writeBlocking(["[default]osUser"], values)

Note my Gateway is Linux. You will need to find a Windows equivalent if you are using that on your Gateway.

And if two designers are running? Or no designers are running?

What you are trying to do is fundamentally flawed. There are efforts to support this from a java add-on module, IIRC, by hooking designer save operations.

There must be always at least one designer running, because, obviously someone will work on some project, therefore he will update the project and gateway event will fire