PeerTube/shared/extra-utils/server/follows.ts

21 lines
490 B
TypeScript
Raw Normal View History

import { waitJobs } from './jobs'
2021-07-16 09:47:51 +02:00
import { PeerTubeServer } from './server'
2017-11-21 13:43:29 +01:00
2021-07-16 09:47:51 +02:00
async function doubleFollow (server1: PeerTubeServer, server2: PeerTubeServer) {
2017-11-17 11:35:10 +01:00
await Promise.all([
server1.follows.follow({ hosts: [ server2.url ] }),
server2.follows.follow({ hosts: [ server1.url ] })
2017-11-17 11:35:10 +01:00
])
// Wait request propagation
await waitJobs([ server1, server2 ])
2017-11-17 11:35:10 +01:00
return true
}
2017-11-16 17:16:42 +01:00
// ---------------------------------------------------------------------------
export {
2021-07-07 09:16:40 +02:00
doubleFollow
2017-11-16 17:16:42 +01:00
}