cleaned helper function location
This commit is contained in:
parent
76aadefc5e
commit
e337025006
2 changed files with 12 additions and 14 deletions
|
@ -112,7 +112,6 @@ module.exports = {
|
|||
},
|
||||
createChannel (name) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// make the request
|
||||
axios
|
||||
.post(lbryApiUrl, {
|
||||
method: 'channel_new',
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue