diff --git a/helpers/lbryApi.js b/helpers/lbryApi.js index 780734c9..a8fd1b35 100644 --- a/helpers/lbryApi.js +++ b/helpers/lbryApi.js @@ -112,7 +112,6 @@ module.exports = { }, createChannel (name) { return new Promise((resolve, reject) => { - // make the request axios .post(lbryApiUrl, { method: 'channel_new', diff --git a/helpers/statsHelpers.js b/helpers/statsHelpers.js index 1eff86e8..d4de3df9 100644 --- a/helpers/statsHelpers.js +++ b/helpers/statsHelpers.js @@ -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; }