2018-06-13 04:06:50 -04:00
|
|
|
import { waitJobs } from './jobs'
|
2021-07-16 03:47:51 -04:00
|
|
|
import { PeerTubeServer } from './server'
|
2017-11-21 07:43:29 -05:00
|
|
|
|
2021-07-16 03:47:51 -04:00
|
|
|
async function doubleFollow (server1: PeerTubeServer, server2: PeerTubeServer) {
|
2017-11-17 05:35:10 -05:00
|
|
|
await Promise.all([
|
2021-07-20 08:15:15 -04:00
|
|
|
server1.follows.follow({ hosts: [ server2.url ] }),
|
|
|
|
server2.follows.follow({ hosts: [ server1.url ] })
|
2017-11-17 05:35:10 -05:00
|
|
|
])
|
|
|
|
|
2017-11-17 09:42:12 -05:00
|
|
|
// Wait request propagation
|
2018-06-13 04:06:50 -04:00
|
|
|
await waitJobs([ server1, server2 ])
|
2017-11-17 09:42:12 -05:00
|
|
|
|
2017-11-17 05:35:10 -05:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2017-11-16 11:16:42 -05:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
2021-07-07 03:16:40 -04:00
|
|
|
doubleFollow
|
2017-11-16 11:16:42 -05:00
|
|
|
}
|