mirror of
https://github.com/borgbase/vorta
synced 2024-12-22 07:43:09 +00:00
V0.6.3 (#102)
* Support scheduler intervals of > 23 hours. Fixes #101 * Remove background jobs, when removing profile. Avoid deleting last profile. Fixes #98
This commit is contained in:
parent
8efaaae08f
commit
cc9adae70c
4 changed files with 21 additions and 9 deletions
5
Makefile
5
Makefile
|
@ -23,9 +23,8 @@ pypi-release:
|
|||
|
||||
bump-version:
|
||||
bumpversion patch
|
||||
# bumpversion minor
|
||||
git push
|
||||
git push --tags
|
||||
#bumpversion minor
|
||||
git push upstream
|
||||
|
||||
travis-debug:
|
||||
curl -s -X POST \
|
||||
|
|
|
@ -101,7 +101,7 @@ font-weight: bold;
|
|||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>48</number>
|
||||
<number>740</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -341,7 +341,7 @@ font-weight: bold;
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>663</width>
|
||||
<height>393</height>
|
||||
<height>388</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="icon">
|
||||
|
@ -370,7 +370,7 @@ font-weight: bold;
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>663</width>
|
||||
<height>393</height>
|
||||
<height>388</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="icon">
|
||||
|
|
|
@ -25,8 +25,15 @@ def reload(self):
|
|||
trigger = None
|
||||
job_id = f'{profile.id}'
|
||||
if profile.schedule_mode == 'interval':
|
||||
trigger = cron.CronTrigger(hour=f'*/{profile.schedule_interval_hours}',
|
||||
minute=profile.schedule_interval_minutes)
|
||||
if profile.schedule_interval_hours > 23:
|
||||
days = profile.schedule_interval_hours // 24
|
||||
leftover_hours = profile.schedule_interval_hours % 24
|
||||
trigger = cron.CronTrigger(day=f'*/{days}',
|
||||
hour=f'*/{leftover_hours}',
|
||||
minute=profile.schedule_interval_minutes)
|
||||
else:
|
||||
trigger = cron.CronTrigger(hour=f'*/{profile.schedule_interval_hours}',
|
||||
minute=profile.schedule_interval_minutes)
|
||||
elif profile.schedule_mode == 'fixed':
|
||||
trigger = cron.CronTrigger(hour=profile.schedule_fixed_hour,
|
||||
minute=profile.schedule_fixed_minute)
|
||||
|
|
|
@ -115,8 +115,14 @@ def profile_rename_action(self):
|
|||
self.profileSelector.setItemText(self.profileSelector.currentIndex(), window.edited_profile.name)
|
||||
|
||||
def profile_delete_action(self):
|
||||
if self.profileSelector.count() >= 3:
|
||||
if self.profileSelector.count() > 3:
|
||||
to_delete = BackupProfileModel.get(id=self.profileSelector.currentData())
|
||||
|
||||
# Remove pending background jobs
|
||||
to_delete_id = str(to_delete.id)
|
||||
if self.app.scheduler.get_job(to_delete_id):
|
||||
self.app.scheduler.remove_job(to_delete_id)
|
||||
|
||||
to_delete.delete_instance(recursive=True)
|
||||
self.profileSelector.removeItem(self.profileSelector.currentIndex())
|
||||
self.profile_select_action(1)
|
||||
|
|
Loading…
Reference in a new issue