From e996f0fb306bf3d9c397154f95f2177e1d5906b7 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Wed, 29 Nov 2023 11:57:25 +0100 Subject: [PATCH] edi: raise send job prio to max Try to send out the file as fast as possible once the content is ready. --- edi_oca/models/edi_backend.py | 5 +++-- edi_oca/tests/test_backend_output.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/edi_oca/models/edi_backend.py b/edi_oca/models/edi_backend.py index 2293943b0a..a955c501c9 100644 --- a/edi_oca/models/edi_backend.py +++ b/edi_oca/models/edi_backend.py @@ -399,8 +399,9 @@ def _check_output_exchange_sync( for rec in new_records: job1 = rec.delayable().action_exchange_generate() if not skip_send: - # Chain send job - job1.on_done(rec.delayable().action_exchange_send()) + # Chain send job. + # Raise prio to max to send the record out as fast as possible. + job1.on_done(rec.delayable(priority=0).action_exchange_send()) job1.delay() if skip_send: diff --git a/edi_oca/tests/test_backend_output.py b/edi_oca/tests/test_backend_output.py index 07a9f1b2f1..a7a63d74ea 100644 --- a/edi_oca/tests/test_backend_output.py +++ b/edi_oca/tests/test_backend_output.py @@ -139,7 +139,7 @@ def test_job(self): self.record.action_exchange_generate, ) trap.assert_enqueued_job( - self.record.action_exchange_send, + self.record.action_exchange_send, properties=dict(priority=0) ) # No matter how many times we schedule jobs self.record.with_delay().action_exchange_generate()