The "handled" flag on responses should not persist across calls

This commit is contained in:
Aldo Cortesi 2016-07-17 11:06:29 +12:00
parent 11bd911e45
commit ca7ca8ec24

View File

@ -220,6 +220,12 @@ def handler(f):
if handling and not message.reply.acked and not message.reply.taken: if handling and not message.reply.acked and not message.reply.taken:
message.reply.ack() message.reply.ack()
# Reset the handled flag - it's common for us to feed the same object
# through handlers repeatedly, so we don't want this to persist across
# calls.
if message.reply.handled:
message.reply.handled = False
return ret return ret
# Mark this function as a handler wrapper # Mark this function as a handler wrapper
wrapper.__dict__["__handler"] = True wrapper.__dict__["__handler"] = True