Commit be578e3
committed
fix(usage-bar): evict oldest template cache entry when size exceeds limit
The module-level fileCache Map grows without bound and holds a live
fs.watch watcher for each cached template file. Evict the oldest
entry (closing its watcher) when the cache reaches MAX_FILE_CACHE_SIZE
(64) so long-running gateways do not accumulate unused watchers.
Fixes #989601 parent 2e049f5 commit be578e3
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
146 | 157 | | |
147 | 158 | | |
148 | 159 | | |
| |||
0 commit comments