wip
This commit is contained in:
@@ -216,6 +216,8 @@ async def _sync_outlook_data(dry_run, vdir, icsfile, org, days_back, days_forwar
|
||||
task_archive = progress.add_task("[yellow]Archiving mail...", total=0)
|
||||
task_delete = progress.add_task("[red]Deleting mail...", total=0)
|
||||
|
||||
# Stage 1: Synchronize local changes (read, archive, delete) to the server
|
||||
progress.console.print("[bold cyan]Step 1: Syncing local changes to server...[/bold cyan]")
|
||||
await asyncio.gather(
|
||||
synchronize_maildir_async(
|
||||
maildir_path, headers, progress, task_read, dry_run
|
||||
@@ -224,6 +226,12 @@ async def _sync_outlook_data(dry_run, vdir, icsfile, org, days_back, days_forwar
|
||||
progress, task_archive, dry_run),
|
||||
delete_mail_async(maildir_path, headers,
|
||||
progress, task_delete, dry_run),
|
||||
)
|
||||
progress.console.print("[bold green]Step 1: Local changes synced.[/bold green]")
|
||||
|
||||
# Stage 2: Fetch new data from the server
|
||||
progress.console.print("\n[bold cyan]Step 2: Fetching new data from server...[/bold cyan]")
|
||||
await asyncio.gather(
|
||||
fetch_mail_async(
|
||||
maildir_path,
|
||||
attachments_dir,
|
||||
@@ -235,6 +243,7 @@ async def _sync_outlook_data(dry_run, vdir, icsfile, org, days_back, days_forwar
|
||||
),
|
||||
fetch_calendar_async(headers, progress, task_calendar, dry_run, vdir, icsfile, org, days_back, days_forward, continue_iteration),
|
||||
)
|
||||
progress.console.print("[bold green]Step 2: New data fetched.[/bold green]")
|
||||
click.echo("Sync complete.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user