-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression: not respecting interval in read_with_poll (#343)
* Fix regression: not respecting interval in read_with_poll The regression happened in the port to PL/pgSQL. Division of integers on postgres yields integer results. Our unit conversion from milliseconds to seconds didn't consider that, then returning wrong results. This caused `pgmq.read_with_poll` to sleep 0s instead of `poll_interval_ms` if `poll_interval_ms` was under 1000, using 100% of CPU. The fix is simply converting `poll_interval_ms` to `numeric` before doing the division, which produces a `numeric` result as originally intended. * Fix tests
- Loading branch information
Showing
4 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters