Skip to content

Commit

Permalink
remove PARALLEL
Browse files Browse the repository at this point in the history
  • Loading branch information
simon300000 committed Nov 11, 2019
1 parent 47c6d93 commit a543730
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const makeURL = nickname => {
}

module.exports = async ({ state, db }) => {
const PARALLEL = 32
const PING_INTERVAL = 1000 * 30
const INTERVAL = await db.get('INTERVAL').catch(() => 840)
let nickname = await db.get('nickname').catch(() => undefined)
Expand All @@ -39,7 +38,7 @@ module.exports = async ({ state, db }) => {
console.log(`using: ${wsURL}`)
state.nickname = nickname

const dd = new DDAtHome(wsURL, { PARALLEL, PING_INTERVAL, INTERVAL })
const dd = new DDAtHome(wsURL, { PING_INTERVAL, INTERVAL })

dd.on('open', () => {
state.INTERVAL = dd.INTERVAL
Expand All @@ -53,7 +52,7 @@ module.exports = async ({ state, db }) => {

dd.on('done', (now, duration, url) => {
state.delay = Math.round(process.uptime() * 1000 / state.completeNumNow)
console.log(`job complete ${(duration / 1000).toFixed(2)}s`, state.delay, INTERVAL * PARALLEL - Date.now() + now)
console.log(`job complete ${(duration / 1000).toFixed(2)}s`, state.delay)
state.log = url
state.completeNum++
state.completeNumNow++
Expand Down

0 comments on commit a543730

Please sign in to comment.