()
| 384 | } |
| 385 | |
| 386 | private async getAllTasks(): Promise<TaskInfo[]> { |
| 387 | const cacheKey = `all-tasks-${JSON.stringify(this.currentFilters)}`; |
| 388 | |
| 389 | // Check cache first |
| 390 | if (this.isCacheValid() && this.statsCache.has(cacheKey)) { |
| 391 | const cached = this.statsCache.get(cacheKey); |
| 392 | if (cached) { |
| 393 | return cached; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | // Get all tasks from the cache |
| 398 | const allTaskPaths = this.plugin.cacheManager.getAllTaskPaths(); |
| 399 | let tasks: TaskInfo[] = []; |
| 400 | |
| 401 | for (const path of allTaskPaths) { |
| 402 | try { |
| 403 | const task = await this.plugin.cacheManager.getTaskInfo(path); |
| 404 | if (task) { |
| 405 | tasks.push(task); |
| 406 | } |
| 407 | } catch { |
| 408 | // Failed to get task info - continue silently |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | tasks = filterStatsVisibleTasks(tasks); |
| 413 | |
| 414 | // Apply filters |
| 415 | tasks = this.applyTaskFilters(tasks); |
| 416 | |
| 417 | // Cache the results |
| 418 | this.statsCache.set(cacheKey, tasks); |
| 419 | this.lastCacheTime = Date.now(); |
| 420 | |
| 421 | return tasks; |
| 422 | } |
| 423 | |
| 424 | /** |
| 425 | * Apply current filters to task list |
no test coverage detected