Skip to content

Commit 25cbf72

Browse files
committed
Fix CLI backup commands not queuing when backup is running (#2299)
Remove the global is_worker_running() check in message_received_event_response() that was rejecting CLI backup commands when any backup was already running. The JobsManager already handles proper per-repository queuing: - Multiple profiles on the same repo queue sequentially - Multiple profiles on different repos run in parallel Also add early return when profile has no repo and info-level logging when a backup is queued via CLI. Fixes #2299
1 parent b7bc469 commit 25cbf72

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/vorta/application.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ def create_backups_cmdline(self, profile_name):
9595
if profile is not None:
9696
if profile.repo is None:
9797
logger.warning(f"Add a repository to {profile_name}")
98+
return
99+
logger.info(f"Queueing backup for profile '{profile_name}'")
98100
self.create_backup_action(profile_id=profile.id)
99101
else:
100102
logger.warning(f"Invalid profile name {profile_name}")
@@ -157,11 +159,8 @@ def message_received_event_response(self, message):
157159
if message == "open main window":
158160
self.open_main_window_action()
159161
elif message.startswith("create"):
160-
message = message[7:] # Remove create
161-
if self.jobs_manager.is_worker_running():
162-
logger.warning("Cannot run while backups are already running")
163-
else:
164-
self.create_backups_cmdline(message)
162+
profile_name = message[7:] # Remove "create " prefix
163+
self.create_backups_cmdline(profile_name)
165164

166165
# No need to add this function to JobsManager because it doesn't require to lock a repo.
167166
def set_borg_details_action(self):

0 commit comments

Comments
 (0)