Skip to content

Commit

Permalink
edi: chain generate/send jobs
Browse files Browse the repository at this point in the history
Instead of waiting for the cron to pass again and send the file
chain the 2 jobs so that it gets sent right after generation.
  • Loading branch information
simahawk committed Jul 6, 2023
1 parent 037da12 commit ccd9397
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion edi_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ def _check_output_exchange_sync(
len(new_records),
)
for rec in new_records:
rec.with_delay().action_exchange_generate()
job1 = rec.delayable().action_exchange_generate()
if not skip_send:
# Chain send job
job1.on_done(rec.delayable().action_exchange_send())
job1.delay()

if skip_send:
return
Expand Down

0 comments on commit ccd9397

Please sign in to comment.