Nothing in ssb-server fetches blobs mentioned in replicated messages; that was happening via ssb-blobs sympathy, which is the same mechanism that let strangers fill the disk. This replaces it with explicit wants scoped to feeds we actually replicate. want() has no expiry and the want map is broadcast to every peer on connect, so a standing want fires whenever a long-offline peer returns. sbot keeps that map in memory, so this process ties its lifetime to the connection and re-arms the backfill on every restart. Verified: removing a referenced blob makes it report already_have=266 newly_wanted=1 and issue the want.
14 lines
533 B
Bash
Executable File
14 lines
533 B
Bash
Executable File
#!/bin/bash
|
|
# run-blob-wanter.sh
|
|
# Same shape as run-server.sh / run-ssb-viewer.sh: keep it alive, and let the
|
|
# process exit cleanly when its sbot connection dies.
|
|
#
|
|
# Restarting on sbot loss is not just tolerated here, it is REQUIRED: sbot's
|
|
# want map is in-memory and is wiped on every sbot restart. Coming back up
|
|
# re-runs the backfill and re-arms every standing want.
|
|
while true; do
|
|
NODE_OPTIONS="--dns-result-order=ipv4first --max-old-space-size=128" ./blob-wanter.js
|
|
echo "Restarting blob-wanter at $(date)"
|
|
sleep 5
|
|
done
|