You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe we are doing integer division which is why we can only specify multiples of full seconds.
In that way defining a timeout parameter as milliseconds integer is very confusing.
I think this is where we are doing an integer division by mistake:
Proposed solutions
Use datetime.timedelta type for the timeout, use datetime.datetime type (datetime.now() ) for end_time calculation.
If you want I could raise a PR with the respective changes.
Checklist
Does your title concisely summarize the problem?
Did you include a minimal, reproducible example?
What OS are you using?
What version of Dramatiq are you using?
What did you do?
What did you expect would happen?
What happened?
What OS are you using?
Manjaro Linux and MacOS
What version of Dramatiq are you using?
1.17.0
What did you do?
This does not work: message_1.get_result(block=True, timeout=100)
This does work: message_1.get_result(block=True, timeout=1000)
What did you expect would happen?
I expect it to also work with values < 1000
What happened?
It always returns an error.
The text was updated successfully, but these errors were encountered:
JanBeelte
changed the title
get_result() always return an error if timeout < 1000
get_result() always returns an error if timeout < 1000
Sep 4, 2024
Issues
I believe we are doing integer division which is why we can only specify multiples of full seconds.
In that way defining a timeout parameter as milliseconds integer is very confusing.
I think this is where we are doing an integer division by mistake:
Proposed solutions
Use datetime.timedelta type for the timeout, use datetime.datetime type (datetime.now() ) for end_time calculation.
If you want I could raise a PR with the respective changes.
Checklist
What OS are you using?
Manjaro Linux and MacOS
What version of Dramatiq are you using?
1.17.0
What did you do?
This does not work:
message_1.get_result(block=True, timeout=100)
This does work:
message_1.get_result(block=True, timeout=1000)
What did you expect would happen?
I expect it to also work with values < 1000
What happened?
It always returns an error.
The text was updated successfully, but these errors were encountered: