frontera icon indicating copy to clipboard operation
frontera copied to clipboard

Fix bug when ordering elements on queue when get next batch of requests

Open jpbalarini opened this issue 6 years ago • 6 comments

I found that when using a MySQL database as backend the queue table was being consumed in the opposite order as intended (elements with lower priority were being consumed first).

I found that on the queue component the _order_by method had no default order condition, so I added an explicit desc() clause (elements with bigger priority first). I guess this can apply to other backends (Postgres).

Thanks!

jpbalarini avatar Nov 15 '18 14:11 jpbalarini

Great! Thanks for this fix!

icapurro avatar Nov 16 '18 13:11 icapurro

@sibiryakov what do you think of this? Can we merge it? Thanks!

jpbalarini avatar Nov 29 '18 14:11 jpbalarini

hey @jpbalarini thanks for the contribution, will try to respond quicker next time. It seems this wasn't covered with the test, can you add them?

sibiryakov avatar Nov 29 '18 15:11 sibiryakov

@sibiryakov done! added tests for the SQL alchemy Queue component. That class should have 100% code coverage now.

Thanks!

jpbalarini avatar Dec 27 '18 19:12 jpbalarini

Hi @sibiryakov I added the tests and everything as requested some time ago. Thanks!

jpbalarini avatar May 17 '19 20:05 jpbalarini

When this fix will be applied?

Prometheus3375 avatar Jul 01 '20 00:07 Prometheus3375