| 323 | } |
| 324 | |
| 325 | func (c *cachedEntry) canReuse(ws Workspace, snapshots map[string]filesnap.Snapshot) bool { |
| 326 | if c == nil { |
| 327 | return false |
| 328 | } |
| 329 | if !filesnap.Equal(c.snapshots, snapshots) { |
| 330 | return false |
| 331 | } |
| 332 | if strings.TrimSpace(c.workspace.DefaultAgent) != strings.TrimSpace(ws.DefaultAgent) { |
| 333 | return false |
| 334 | } |
| 335 | if strings.TrimSpace(c.workspace.SandboxRef) != strings.TrimSpace(ws.SandboxRef) { |
| 336 | return false |
| 337 | } |
| 338 | if strings.TrimSpace(c.workspace.RootDir) != strings.TrimSpace(ws.RootDir) { |
| 339 | return false |
| 340 | } |
| 341 | if !slices.Equal(c.workspace.AdditionalDirs, ws.AdditionalDirs) { |
| 342 | return false |
| 343 | } |
| 344 | |
| 345 | return true |
| 346 | } |
| 347 | |
| 348 | func (r *Resolver) evictExpiredLocked(now time.Time) { |
| 349 | cutoff := now.Add(-r.cacheTTL) |