`keepAlive` JSDoc points at `stop()` for a footgun
Author: janbucharCreated Sep 18, 2026Updated Sep 18, 2026
Labelst-tooling
- The
keepAliveoption says to "usecrawler.stop()to exit the crawler gracefully".stop()only halts dispatch; whatever is still queued stays queued. For the casekeepAliveis usually reached for — a crawler fed by another crawler or an external producer — callingstop()when the producer finishes drops everything the consumer had not picked up yet (in a local test, 20 of 20). - Point the JSDoc at
taskLoopOptions.isFinishedFunctionwith(await manager.checkReadiness()).status === 'finished'plus the producer'srunningflag, and say plainly whatstop()does.stop({ drain: true })would be nice but the doc fix is the important part.
Source: apify/crawlee