Update send_node_digest_notifications.py
This commit is contained in:
parent
33905a6891
commit
0fdb2bb529
1 changed files with 3 additions and 6 deletions
|
|
@ -16,16 +16,13 @@ def main():
|
|||
|
||||
with bootstrap(args.config) as env:
|
||||
request = env["request"]
|
||||
with transaction.manager:
|
||||
with request.tm:
|
||||
try:
|
||||
deliver_scheduled_notifications(request)
|
||||
print("Committing transaction.")
|
||||
transaction.commit()
|
||||
print("Committed transaction.")
|
||||
print("Notifications processed successfully.")
|
||||
raise SystemExit(0)
|
||||
except Exception as e:
|
||||
print("Aborting transaction.")
|
||||
transaction.abort()
|
||||
print("Error processing notifications:", str(e))
|
||||
raise SystemExit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue