follows.ts 490 B

1234567891011121314151617181920
  1. import { waitJobs } from './jobs'
  2. import { PeerTubeServer } from './server'
  3. async function doubleFollow (server1: PeerTubeServer, server2: PeerTubeServer) {
  4. await Promise.all([
  5. server1.follows.follow({ hosts: [ server2.url ] }),
  6. server2.follows.follow({ hosts: [ server1.url ] })
  7. ])
  8. // Wait request propagation
  9. await waitJobs([ server1, server2 ])
  10. return true
  11. }
  12. // ---------------------------------------------------------------------------
  13. export {
  14. doubleFollow
  15. }