ServerInfo,
setAccessTokensToServers,
uploadVideo
-} from '../utils'
+} from '../../../shared/utils'
import * as Bluebird from 'bluebird'
start()
// Forever
const fakeTab = Array.from(Array(1000000).keys())
- await Bluebird.map(fakeTab, () => {
- return Promise.all([
- uploadCustom(server),
- likeCustom(server),
- dislikeCustom(server),
- createUserCustom(server),
- createCustomChannel(server)
- ]).catch(err => console.error(err))
- }, { concurrency: 5 })
+ const funs = [
+ uploadCustom
+ // uploadCustom,
+ // uploadCustom,
+ // uploadCustom,
+ // likeCustom,
+ // createUserCustom,
+ // createCustomChannel
+ ]
+ const promises = []
+
+ for (const fun of funs) {
+ promises.push(
+ Bluebird.map(fakeTab, () => {
+ return fun(server).catch(err => console.error(err))
+ }, { concurrency: 3 })
+ )
+ }
+
+ await Promise.all(promises)
}
function getRandomInt (min, max) {
function createCustomChannel (server: ServerInfo) {
const videoChannel = {
+ name: Date.now().toString(),
displayName: Date.now().toString(),
description: Date.now().toString()
}