Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shriramshankar committed Aug 16, 2017
1 parent 5a43560 commit dd62ec5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion config/toggles.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const shortTermToggles = {
// publish partial sample to the subscribers
publishPartialSample: environmentVariableTrue(pe, 'PUBLISH_PARTIAL_SAMPLE'),


}; // shortTermToggles

featureToggles.load(Object.assign({}, longTermToggles, shortTermToggles));
Expand Down
1 change: 1 addition & 0 deletions realtime/redisPublisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function publishObject(inst, event, changedKeys, ignoreAttributes) {
*/
function publishPartialSample(sampleInst, event) {
const eventType = event || getSampleEventType(sampleInst);

// will be over written when unwrapping json.stringified fields
const sample = sampleInst.get ? sampleInst.get() : sampleInst;
publishObject(sample, eventType);
Expand Down
16 changes: 6 additions & 10 deletions realtime/redisSubscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,22 @@ module.exports = (io) => {
// message object to be sent to the clients
const mssgObj = JSON.parse(mssgStr);
const key = Object.keys(mssgObj)[0];
console.log('-----key---', key);
const parsedObj = rtUtils.parseObject(mssgObj[key], key);
if (featureToggles.isFeatureEnabled('publishPartialSample') &&
rtUtils.isThisSample(parsedObj)) {
const useSampleStore =
featureToggles.isFeatureEnabled('enableRedisSampleStore');
/*
* assign the subjectModel to the database model if sampleStore is
* not enabled
*/

// assign the subject db model if sampleStore is not enabled
const subjectModel =
useSampleStore ? undefined :
require('../db/index').Subject; // eslint-disable-line global-require
rtUtils.attachAspectSubject(parsedObj, useSampleStore, subjectModel)
.then((obj) => {
console.log('object to be emitted this is a complete sample', obj);
/*
* pass on the message received through the redis subscriber to the
* socket io emitter to send data to the browser clients.
*/
/*
* pass on the message received through the redis subscriber to the
* socket io emitter to send data to the browser clients.
*/
emitter(io, key, obj);
});
} else {
Expand Down

0 comments on commit dd62ec5

Please sign in to comment.