Change notificationworker to use a data interface

This commit is contained in:
Joseph Schorr 2017-07-12 15:50:47 +03:00
parent 8ec198228c
commit b6f1782642
10 changed files with 149 additions and 56 deletions

View file

@ -125,10 +125,12 @@ def delete_matching_notifications(target, kind_name, **kwargs):
notification.delete_instance()
def increment_notification_failure_count(notification_id):
def increment_notification_failure_count(uuid):
""" This increments the number of failures by one """
RepositoryNotification.update(number_of_failures=RepositoryNotification.number_of_failures + 1).where(
RepositoryNotification.id == notification_id).execute()
(RepositoryNotification
.update(number_of_failures=RepositoryNotification.number_of_failures + 1)
.where(RepositoryNotification.uuid == uuid)
.execute())
def reset_notification_number_of_failures(namespace_name, repository_name, uuid):