fix: Add teardown callback for mobile guide (#183)

Users should close resources like autopass in a teardown callback. In
this case it will speed up reruns as `pass.close()` calls hyperswarm's
`.destroy()` which will clean up the DHT records, speeding up joining on
rerun.
This commit is contained in:
Sean Zellmer
2025-04-24 21:09:04 -05:00
committed by GitHub
parent 7c67031787
commit 2ed09ca009

View File

@@ -237,6 +237,7 @@ fs.mkdirSync(path)
const invite = Bare.argv[1]
const pair = Autopass.pair(new Corestore(path), invite)
const pass = await pair.finished()
Bare.on('teardown', () => pass.close())
await pass.ready()