mobiletto 1.1.34 → 1.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +11 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -504,20 +504,20 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
504
504
  logger.error(message)
505
505
  throw new MobilettoError(message)
506
506
  }
507
- META_LOAD_QUEUE = new Queue(META_LOAD_QUEUE_NAME, `redis://${client.redisConfig.host || '127.0.0.1'}:${client.redisConfig.port || 6379}`)
507
+ META_LOAD_QUEUE = new Queue(META_LOAD_QUEUE_NAME, `redis://${client.redisConfig.host || REDIS_HOST}:${client.redisConfig.port || REDIS_PORT}`)
508
508
  META_LOAD_QUEUE.mobilettoHandlers = {}
509
509
  META_LOAD_QUEUE.mobilettoErrorHandlers = {}
510
510
  META_LOAD_QUEUE.process(META_LOAD_JOB_NAME, META_LOAD_CONCURRENCY, _singleMeta)
511
511
  META_LOAD_QUEUE.on('completed', function (job, result) {
512
512
  logger.info(`${META_LOAD_JOB_NAME} completed with result: ${JSON.stringify(result)}`)
513
- if (job.data.jobId && META_LOAD_QUEUE.mobilettoHandlers[job.data.jobId]) {
514
- META_LOAD_QUEUE.mobilettoHandlers[job.data.jobId](result)
513
+ if (job.data.mobilettoJobID && META_LOAD_QUEUE.mobilettoHandlers[job.data.mobilettoJobID]) {
514
+ META_LOAD_QUEUE.mobilettoHandlers[job.data.mobilettoJobID](result)
515
515
  }
516
516
  })
517
517
  META_LOAD_QUEUE.on('failed', function (job, result) {
518
518
  logger.info(`${META_LOAD_JOB_NAME} failed with result: ${JSON.stringify(result)}`)
519
- if (job.data.jobId && META_LOAD_QUEUE.mobilettoErrorHandlers[job.data.jobId]) {
520
- META_LOAD_QUEUE.mobilettoErrorHandlers[job.data.jobId](result)
519
+ if (job.data.mobilettoJobID && META_LOAD_QUEUE.mobilettoErrorHandlers[job.data.mobilettoJobID]) {
520
+ META_LOAD_QUEUE.mobilettoErrorHandlers[job.data.mobilettoJobID](result)
521
521
  }
522
522
  })
523
523
  }
@@ -535,17 +535,17 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
535
535
  }
536
536
  }
537
537
 
538
- const jobId = randomstring.generate(10)
538
+ const mobilettoJobID = randomstring.generate(10)
539
539
  const mq = metaLoadQueue()
540
- mq.mobilettoHandlers[jobId] = meta => files.push(meta)
541
- mq.mobilettoErrorHandlers[jobId] = err => files.push(err)
540
+ mq.mobilettoHandlers[mobilettoJobID] = meta => files.push(meta)
541
+ mq.mobilettoErrorHandlers[mobilettoJobID] = err => files.push(err)
542
542
  for (const entry of entries) {
543
- const job = { jobId, dirent, entry, files }
543
+ const job = { mobilettoJobID, dirent, entry }
544
544
  mq.add(META_LOAD_JOB_NAME, job)
545
545
  }
546
546
  await new Promise(resolve => waitForFiles(resolve))
547
- delete mq.mobilettoHandlers[jobId]
548
- delete mq.mobilettoErrorHandlers[jobId]
547
+ delete mq.mobilettoHandlers[mobilettoJobID]
548
+ delete mq.mobilettoErrorHandlers[mobilettoJobID]
549
549
  return files
550
550
  }
551
551
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
4
  "description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, and local storage",
5
5
  "main": "index.js",
6
6
  "keywords": [