cleaned helper function location

This commit is contained in:
bill bittner 2018-01-23 12:47:10 -08:00
parent 76aadefc5e
commit e337025006
2 changed files with 12 additions and 14 deletions

View file

@ -112,7 +112,6 @@ module.exports = {
},
createChannel (name) {
return new Promise((resolve, reject) => {
// make the request
axios
.post(lbryApiUrl, {
method: 'channel_new',

View file

@ -5,19 +5,18 @@ const config = require('../config/speechConfig.js');
const googleApiKey = config.analytics.googleId;
const db = require('../models');
function createPublishTimingEventParams (publishDurration, ip, headers, label) {
return {
userTimingCategory : 'lbrynet',
userTimingVariableName: 'publish',
userTimingTime : publishDurration,
userTimingLabel : label,
uip : ip,
ua : headers['user-agent'],
ul : headers['accept-language'],
};
};
module.exports = {
createPublishTimingEventParams (publishDurration, ip, headers, label) {
return {
userTimingCategory : 'lbrynet',
userTimingVariableName: 'publish',
userTimingTime : publishDurration,
userTimingLabel : label,
uip : ip,
ua : headers['user-agent'],
ul : headers['accept-language'],
};
},
postToStats (action, url, ipAddress, name, claimId, result) {
logger.debug('action:', action);
// make sure the result is a string
@ -82,7 +81,7 @@ module.exports = {
case constants.PUBLISH_ANONYMOUS_CLAIM:
case constants.PUBLISH_IN_CHANNEL_CLAIM:
logger.verbose(`${action} completed successfully in ${durration}ms`);
params = createPublishTimingEventParams(durration, ip, headers, action);
params = module.exports.createPublishTimingEventParams(durration, ip, headers, action);
break;
default: break;
}