25d80c8132
One Python process for 2015 activities exhausts all RAM + swap on a cheap VPS. Split into sequential batches of 100: each subprocess handles 100 activities and exits, returning all memory to the OS before the next batch starts. The server chains batches in the SSE event_stream and triggers a single rebuild when all batches complete.