ensl_gathers/lib/user/helper.js

18 lines
383 B
JavaScript
Raw Normal View History

2015-08-18 11:40:48 +00:00
"use strict";
var User = require("../user/user");
var client = require("../ensl/client")();
var async = require("async");
var getRandomUser = callback => {
let id = Math.floor(Math.random() * 5000) + 1;
2015-08-28 14:00:14 +00:00
User.find(id, function (error, user) {
if (error) return getRandomUser(callback);
return callback(error, user);
})
2015-08-18 11:40:48 +00:00
};
module.exports = {
getRandomUser: getRandomUser
};