Update send_node_digest_notifications.py
This commit is contained in:
parent
197a868833
commit
c8912232a2
1 changed files with 18 additions and 5 deletions
|
|
@ -4,10 +4,10 @@ from . import base_parser
|
|||
import transaction
|
||||
|
||||
|
||||
def get_arg_parser():
|
||||
parser = base_parser("Send Node Notification Digests.")
|
||||
return parser
|
||||
|
||||
def get_arg_parser():
|
||||
parser = base_parser(" Send Node Notification Digests.")
|
||||
return parser
|
||||
|
||||
def main():
|
||||
parser = get_arg_parser()
|
||||
|
|
@ -15,5 +15,18 @@ def main():
|
|||
setup_logging(args.config)
|
||||
|
||||
with bootstrap(args.config) as env:
|
||||
deliver_scheduled_notifications(env["request"])
|
||||
transaction.commit()
|
||||
request = env["request"]
|
||||
with transaction.manager:
|
||||
try:
|
||||
deliver_scheduled_notifications(request)
|
||||
print("Committing transaction.")
|
||||
transaction.commit()
|
||||
print("Committed transaction.")
|
||||
raise SystemExit(0)
|
||||
except Exception as e:
|
||||
print("Aborting transaction.")
|
||||
transaction.abort()
|
||||
raise SystemExit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue