mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 14:34:19 +01:00
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:
@@ -237,6 +237,7 @@ fs.mkdirSync(path)
|
|||||||
const invite = Bare.argv[1]
|
const invite = Bare.argv[1]
|
||||||
const pair = Autopass.pair(new Corestore(path), invite)
|
const pair = Autopass.pair(new Corestore(path), invite)
|
||||||
const pass = await pair.finished()
|
const pass = await pair.finished()
|
||||||
|
Bare.on('teardown', () => pass.close())
|
||||||
|
|
||||||
await pass.ready()
|
await pass.ready()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user