Hello, I’ve a weird situation and I wondering is someone has the time to point me in the right direction:
- Before posting and invoice I’m calling a script with subprocess
- All good, but checking the main.py logs seems that main.py gets called twice, always twice.
- I tried calling the script from python3 interpreter >>> but here the script runs only one time.
Question is:
¿I’m using uswgi, maybe is related to threads, workers or something like that? Using trytond I can see only one call to .post[invoice_id] but my script gets called twice, one time and then 5 seconds after the script completes…second time. Sorry if this is not directly related to tryton it self, maybe an internal timeout to retry exists?
@classmethod
@ModelView.button
@Workflow.transition('posted')
def post(cls, invoices):
for invoice in invoices:
try:
rs = subprocess.check_output(["python3.7", "main.py",str(invoice.id),str(invoice.type)])
except Exception as e:
raise UserError('Error al llamar el subproceso : {}'.format(e))