-
Notifications
You must be signed in to change notification settings - Fork 284
Message Queue Storage #4016
Message Queue Storage #4016
Conversation
msg_data = pw.BlobField() | ||
created_date = pw.DateTimeField(default=datetime.datetime.now) | ||
modified_date = pw.DateTimeField(default=datetime.datetime.now) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will messages live forever if they cannot be sent? maybe they should have some lifetime/timeout set? possibly depending on a type maybe? ... (unsure)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are removed after MESSAGE_QUEUE_MAX_AGE
, see method sweep
in msg_queue.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I noticed later
) | ||
msg.header = msg_dt.MessageHeader( | ||
msg.header[0], | ||
int(time.time()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure that this always produces the correct unix epoch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only case it didn't produce expected results was on AppVeyor. We don't use AppVeyor anymore.
) | ||
continue | ||
finally: | ||
db_model.delete_instance() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... what if sending of a message fails at the time it's performed? will message be returned to the queue? ... shouldn't a message be removed from the queue only after it has been successfully sent? ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO the cost of implementing this would be higher than the benefits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, we may leave that as a future improvement if it deems necessary...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## develop #4016 +/- ##
===========================================
+ Coverage 88.6% 88.63% +0.03%
===========================================
Files 211 211
Lines 18414 18388 -26
===========================================
- Hits 16316 16299 -17
+ Misses 2098 2089 -9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, as mentioned above, we can leave it as a future improvement
Complete API for message queue storage.
part of #2223