()
| 894 | || !!(error && error.benignThumbnailDrop); |
| 895 | } |
| 896 | |
| 897 | function dropRenderTask(task, reason) { |
| 898 | if (!task) return; |
| 899 | // Only free the pending slot when nothing is actively rendering this path. |
| 900 | // Otherwise a virtual-grid rebuild can re-enqueue the same file mid-render. |
| 901 | if (task.filePath && !activeThumbnailRenders.has(task.filePath)) { |
| 902 | pendingThumbnails.delete(task.filePath); |
| 903 | } |
| 904 | // Scan/bulk waiters must not hang forever if a task is discarded. |
| 905 | if (typeof task.reject === 'function') { |
| 906 | try { |
| 907 | const err = new Error(reason || 'Render task dropped'); |
| 908 | err.benignThumbnailDrop = true; |
| 909 | task.reject(err); |
no outgoing calls
no test coverage detected