v8.1.27
I just ran into a really weird gateway issue right after I tested a simple script to print a report. Below is the button onActionPerformed
script.
I tested it, and I noticed the gateway immediately restart. I didn't realize that this script was the "problem" until it restarted the gateway again the next time, I tested it. I tried the same script on another gateway that is mirrored to the one that restarts, and it runs perfect and the gateway doesn't restart.
def runAction(self, event):
plant = self.session.custom.plant
department = self.view.params.department
user = self.getSibling("User").props.value
printer = 'P1Engineer'
# if plant == 1:
# if department == 'sewing':
# printer = 'P1Sewing'
# elif department == 'staging':
# printer = 'P1Staging'
# elif plant == 5:
# printer = 'P5Office'
system.report.executeAndDistribute(
path='Employee_Label',
action = 'print',
actionSettings = {'primaryPrinterName':printer, 'copies':1}
)
self.getSibling("Result").props.text = 'Sent to %s' % printer
self.getSibling("Cancel").meta.visible = False
self.getSibling("Confirm").meta.visible = False
The last time I tried the script which forced a restart, the gateway has no logs until it starts to start up again. I have never seen this happen, and it is very strange.