Files
worldmonitor/scripts
Elie Habib ddff426c51 fix(relay): Telegram + OOM + memory cleanup (#531)
* fix(relay): resolve Telegram missing package, OOM crashes, and memory cleanup

- Add `telegram` and `ws` to root dependencies so Railway's `npm install` installs them
- Log V8 heap limit at startup to confirm NODE_OPTIONS is active
- Make MAX_VESSELS/MAX_VESSEL_HISTORY env-configurable (default 20k, down from 50k)
- Add permanent latch to skip Telegram import retries when package is missing
- Raise memory cleanup threshold from 450MB to 2GB (env-configurable)
- Clear all caches (RSS, Polymarket, WorldBank) during emergency cleanup

* fix(relay): treat blank env vars as unset in safeInt

Number('') === 0 passes isFinite, silently clamping caps to 1000
instead of using the 20000 default. Guard empty/null before parsing.
2026-02-28 16:04:57 +04:00
..