Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

changefeed

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

changefeed - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

69

lib/publisher.js

@@ -126,29 +126,50 @@ /*

// Handles bucket initilization and backoff on failure
function _bucketInit() {
var error;
morayClient.getBucket(self.morayBucket.name, function _gb(err) {
if (err && err.name === 'BucketNotFoundError') {
var name = self.morayBucket.name;
var config = self.morayBucket.config;
morayClient.createBucket(name, config, function _cb(err2) {
log.info({ n: name, c: config }, 'cf: creating bucket');
if (err2) {
log.error({ cErr: err2 }, 'cf: Bucket not created');
expBackoff.backoff();
} else {
log.info('cf: Bucket successfully setup');
self.emit('moray-ready');
expBackoff.reset();
}
});
} else if (err) {
log.error({ cErr: err }, 'cf: Bucket was not loaded');
expBackoff.backoff();
} else {
log.info('cf: Bucket successfully setup');
self.emit('moray-ready');
expBackoff.reset();
}
});
}
morayClient.on('error', function _morayError(err) {
log.error(err, 'moray client error');
log.error(err, 'cf: moray client error');
});
expBackoff.on('backoff', function _backoff(number, delay) {
log.warn('Backing off -- retry count: %s delay: %s', number, delay);
log.warn('cf: Backoff -- retry count: %s delay: %s', number, delay);
});
expBackoff.on('ready', function _ready(number, delay) {
// Auto setup the change feed moray bucket
self._setupBucket(function _bucketSetupError(err) {
if (err) {
log.error({ err: err }, 'Bucket was not loaded');
} else {
log.info('Bucket successfully loaded');
self.emit('moray-ready');
expBackoff.reset();
}
});
log.info('cf: Backoff ready -- retry count: %s:', number);
_bucketInit();
});
expBackoff.on('fail', function _fail() {
log.error('backoff failed');
log.error('cf: backoff failed');
self.emit('moray-fail');
});
expBackoff.backoff();
_bucketInit();
});

@@ -344,7 +365,2 @@

Publisher.prototype._createBucket = function _createBucket(cb) {
var bucket = this.morayBucket;
this.morayClient.createBucket(bucket.name, bucket.config, cb);
};
Publisher.prototype._getBucket = function _getBucket(cb) {

@@ -416,17 +432,2 @@ this.morayClient.getBucket(this.morayBucket.name, cb);

Publisher.prototype._setupBucket = function _setupBucket(cb) {
var self = this;
self._getBucket(function _getBucketError(err) {
if (err) {
if (err.name === 'BucketNotFoundError') {
self._createBucket(cb);
} else {
return cb(err);
}
}
return cb(err);
});
};
module.exports = Publisher;
{
"name": "changefeed",
"description": "Change Feed Modules",
"version": "1.1.7",
"version": "1.1.8",
"author": "Joyent (joyent.com)",

@@ -6,0 +6,0 @@ "private": false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc