Commit 76213c3
committed
fix(logs): use userspace polling for -f follow mode
fs.watchFile (libuv uv_fs_poll_t) does not reliably emit change events
for cross-process file appends on Windows, so `bitsocial logs -f` would
silently miss new log lines there. Replace it with a self-rescheduling
setTimeout that calls fs.promises.stat() + reads new bytes — the same
pattern production tail-f libraries use precisely because OS file
watchers aren't cross-platform reliable for this scenario.
Closes #401 parent 6ab08d6 commit 76213c3
1 file changed
Lines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | 257 | | |
260 | 258 | | |
261 | 259 | | |
| |||
279 | 277 | | |
280 | 278 | | |
281 | 279 | | |
282 | | - | |
283 | 280 | | |
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
287 | 284 | | |
288 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
289 | 298 | | |
290 | 299 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
298 | 303 | | |
299 | | - | |
300 | 304 | | |
301 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
302 | 308 | | |
303 | 309 | | |
304 | 310 | | |
| |||
0 commit comments