2018-06-13 10:06:50 +02:00
|
|
|
import { waitJobs } from './jobs'
|
2021-07-07 09:16:40 +02:00
|
|
|
import { ServerInfo } from './servers'
|
2017-11-21 13:43:29 +01:00
|
|
|
|
2017-11-17 11:35:10 +01:00
|
|
|
async function doubleFollow (server1: ServerInfo, server2: ServerInfo) {
|
|
|
|
await Promise.all([
|
2021-07-07 09:16:40 +02:00
|
|
|
server1.followsCommand.follow({ targets: [ server2.url ] }),
|
|
|
|
server2.followsCommand.follow({ targets: [ server1.url ] })
|
2017-11-17 11:35:10 +01:00
|
|
|
])
|
|
|
|
|
2017-11-17 15:42:12 +01:00
|
|
|
// Wait request propagation
|
2018-06-13 10:06:50 +02:00
|
|
|
await waitJobs([ server1, server2 ])
|
2017-11-17 15:42:12 +01:00
|
|
|
|
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
|
|
|
}
|