Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function has(key) {
return cache.has(key);
}
sT.generateServiceSideUsage().then(stAmount => {
debug('Small Talk');
if (!cache.has('dialogCache')) {
debug('dialog has dialog cache');
return DialogSchema.find().then(model => {
debug('Email Talk');
const data = { emails: {}, flow: Convert.convert(model), map: model };
cache.set('dialogCache', {
data,
time: moment.now(),
});
return resolve(
`Updated: ${stAmount} - Dialog Amount: ${
Object.keys(data.flow).length
}`,
);
});
}
return resolve(`Updated: ${stAmount}`);