Created
November 14, 2017 14:20
-
-
Save oak-tree/b4cfa322fdbafe33aedb2b8dd6acd074 to your computer and use it in GitHub Desktop.
azure mssage lock
This file contains hidden or 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
msg_locked_until = dateutil.parser.parse(msg.broker_properties['LockedUntilUtc']) | |
if (datetime.now(utc) + timedelta(0, lock_buff_seconds)) > msg_locked_until: | |
logger.info("Renewing message lock") | |
try: | |
msg.renew_lock() | |
logger.info("Done.") | |
except Exception as e: | |
logger.error("Failed renewing the message lock.") | |
logger.error(e.message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment