Skip to content

Commit

Permalink
Notify after post-backup-tasks borgbase#1632
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLazron committed Feb 21, 2024
1 parent 472c7c8 commit e17e5c0
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/vorta/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,32 @@ def notify(self, result):
profile_id = result['params']['profile'].id

if result['returncode'] in [0, 1]:
notifier.deliver(
self.tr('Vorta Backup'),
self.tr('Backup successful for %s.') % profile_name,
level='info',
)
logger.info('Backup creation successful.')
# unpause scheduler
self.unpause(result['params']['profile_id'])
try:
notifier.deliver(
self.tr('Vorta Backup'),
self.tr('Backup successful for %s.') % profile_name,
level='info',
)
logger.info('Backup creation successful.')
# unpause scheduler
self.unpause(result['params']['profile_id'])

self.post_backup_tasks(profile_id)
self.post_backup_tasks(profile_id)
# Notify after successful post_backup_tasks
notifier.deliver(
self.tr('Vorta Backup'),
self.tr('Post Backup Tasks successful for %s' % profile_id),
level='info',
)
logger.info('Post Backup Tasks successful for %s' % profile_id)

except Exception as e:
# Handle exceptions if post_backup_tasks fails
notifier.deliver(
self.tr('Vorta Backup'),
self.tr('Error during post backup tasks for %s.') % profile_name,
level='error',
)
else:
notifier.deliver(
self.tr('Vorta Backup'),
Expand Down

0 comments on commit e17e5c0

Please sign in to comment.