Skip to content

refactor: Phase 3 — async backup wrappers (#358)#359

Closed
JusterZhu wants to merge 1 commit into
masterfrom
feat/phase3-filetree-async
Closed

refactor: Phase 3 — async backup wrappers (#358)#359
JusterZhu wants to merge 1 commit into
masterfrom
feat/phase3-filetree-async

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

Adds async wrappers for StorageManager backup operations, as specified in section 2.3 of the v2 plan.

Changes

  • StorageManager.BackupAsync — async wrapper for Backup
  • StorageManager.RestoreAsync — async wrapper for Restore
  • StorageManager.CleanBackupAsync — async wrapper for CleanBackup
  • All three delegate to existing sync methods via Task.Run

Note

Full solution: 0 errors
Partial #358

- Added StorageManager.BackupAsync / RestoreAsync / CleanBackupAsync
  (async wrappers delegating to existing sync methods via Task.Run)
- DiffMode wiring + strategy orchestrator integration pending #357 merge

Partial #358
Copilot AI review requested due to automatic review settings May 24, 2026 09:06
@JusterZhu JusterZhu added the refactor Refactor some existing code. label May 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds async wrappers for StorageManager backup operations as part of the GeneralUpdate v2 refactoring plan (Phase 3), enabling callers to invoke backup/restore/cleanup without blocking the calling thread.

Changes:

  • Introduces StorageManager.BackupAsync, RestoreAsync, and CleanBackupAsync wrappers.
  • Each async wrapper delegates to the existing synchronous implementation via Task.Run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +234 to +248

public static async System.Threading.Tasks.Task BackupAsync(string sourcePath, string backupPath, System.Collections.Generic.IReadOnlyList<string> directoryNames)
{
await System.Threading.Tasks.Task.Run(() => Backup(sourcePath, backupPath, directoryNames)).ConfigureAwait(false);
}

public static async System.Threading.Tasks.Task RestoreAsync(string backupPath, string sourcePath)
{
await System.Threading.Tasks.Task.Run(() => Restore(backupPath, sourcePath)).ConfigureAwait(false);
}

public static async System.Threading.Tasks.Task CleanBackupAsync(string installPath, int keepVersions = 3)
{
await System.Threading.Tasks.Task.Run(() => CleanBackup(installPath, keepVersions)).ConfigureAwait(false);
} #endregion
public static async System.Threading.Tasks.Task CleanBackupAsync(string installPath, int keepVersions = 3)
{
await System.Threading.Tasks.Task.Run(() => CleanBackup(installPath, keepVersions)).ConfigureAwait(false);
} #endregion
@JusterZhu JusterZhu closed this May 24, 2026
@JusterZhu JusterZhu deleted the feat/phase3-filetree-async branch May 25, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor some existing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants