Commit 9eaea33
authored
Guarantee output order in batch insertion example (#1206)
Aims to fix an intermittently failing example wherein we can print an
"Inserted ..." message after the work messages coming from each inserted
job.
https://github.com/riverqueue/river/actions/runs/24310710305/job/70979718727
--- FAIL: Example_batchInsert (0.09s)
got:
Worked a job
Worked a job
Worked a job
Worked a job
Worked a job
Inserted 5 jobs
want:
Inserted 5 jobs
Worked a job
Worked a job
Worked a job
Worked a job
Worked a job
FAIL
FAIL github.com/riverqueue/river 26.753s
The fix is pretty straightforward in making sure we do the inserts
(and therefore print the right message) before starting the client and
introducing the possibility that jobs can be worked.1 parent 27a4c30 commit 9eaea33
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 65 | | |
70 | 66 | | |
71 | 67 | | |
| |||
78 | 74 | | |
79 | 75 | | |
80 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
0 commit comments