Skip to content
8 changes: 3 additions & 5 deletions crates/workspace/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1850,12 +1850,10 @@ impl WorkspaceDb {
// If a local workspace points to WSL, this check will cause us to wait for the
// WSL VM and file server to boot up. This can block for many seconds.
// Supported scenarios use remote workspaces.
if !has_wsl_path
&& Self::all_paths_exist_with_a_directory(paths.paths(), fs, Some(timestamp)).await
{
result.push((id, SerializedWorkspaceLocation::Local, paths, timestamp));
} else {
if has_wsl_path || Utc::now() - timestamp >= chrono::Duration::days(7) {
delete_tasks.push(self.delete_workspace_by_id(id));
} else if Self::all_paths_exist_with_a_directory(paths.paths(), fs, None).await {
result.push((id, SerializedWorkspaceLocation::Local, paths, timestamp));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would think we'd want to check if the paths exists first, before possibly deleting them. This seems like it will delete things even if they exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I forgot to take that into consideration in this condition.

I will fix it soon.

}
}

Expand Down
Loading