()
| 144 | * Should be called when the session ends. |
| 145 | */ |
| 146 | export async function cleanupSessionPluginCache(): Promise<void> { |
| 147 | if (!sessionPluginCachePath) { |
| 148 | return |
| 149 | } |
| 150 | try { |
| 151 | await rm(sessionPluginCachePath, { recursive: true, force: true }) |
| 152 | logForDebugging( |
| 153 | `Cleaned up session plugin cache at ${sessionPluginCachePath}`, |
| 154 | ) |
| 155 | } catch (error) { |
| 156 | logForDebugging(`Failed to clean up session plugin cache: ${error}`) |
| 157 | } finally { |
| 158 | sessionPluginCachePath = null |
| 159 | sessionPluginCachePromise = null |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Reset the session plugin cache path (for testing). |
nothing calls this directly
no test coverage detected