|
|
@ -15,7 +15,7 @@ const config = {
|
|
|
|
debug: options.debug
|
|
|
|
debug: options.debug
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const LOGS_PATH = process.env.LOGS_PATH || 'scripts/logs/load-streams'
|
|
|
|
const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs/load-cluster'
|
|
|
|
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
async function main() {
|
|
|
|
logger.info('starting...')
|
|
|
|
logger.info('starting...')
|
|
|
@ -23,11 +23,12 @@ async function main() {
|
|
|
|
logger.info(`delay: ${options.delay}ms`)
|
|
|
|
logger.info(`delay: ${options.delay}ms`)
|
|
|
|
timer.start()
|
|
|
|
timer.start()
|
|
|
|
|
|
|
|
|
|
|
|
const clusterLog = `${LOGS_PATH}/cluster_${options.clusterId}.log`
|
|
|
|
const clusterLog = `${LOGS_DIR}/cluster_${options.clusterId}.log`
|
|
|
|
logger.info(`loading cluster: ${options.clusterId}`)
|
|
|
|
logger.info(`loading cluster: ${options.clusterId}`)
|
|
|
|
logger.info(`creating '${clusterLog}'...`)
|
|
|
|
logger.info(`creating '${clusterLog}'...`)
|
|
|
|
await file.create(clusterLog)
|
|
|
|
await file.create(clusterLog)
|
|
|
|
const items = await db.find({ cluster_id: options.clusterId })
|
|
|
|
await db.streams.load()
|
|
|
|
|
|
|
|
const items = await db.streams.find({ cluster_id: options.clusterId })
|
|
|
|
const total = items.length
|
|
|
|
const total = items.length
|
|
|
|
logger.info(`found ${total} links`)
|
|
|
|
logger.info(`found ${total} links`)
|
|
|
|
|
|
|
|
|