Skip to content

Commit

Permalink
edi: raise send job prio to max
Browse files Browse the repository at this point in the history
Try to send out the file as fast as possible once the content is ready.
  • Loading branch information
simahawk committed Nov 29, 2023
1 parent fc0780a commit e996f0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions edi_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion edi_oca/tests/test_backend_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e996f0f

Please sign in to comment.