(req, sites)
| 49 | } |
| 50 | |
| 51 | async function find_username_normal_wrapper (req, sites) { |
| 52 | const results = [] |
| 53 | const re_try = [] |
| 54 | const functions = [] |
| 55 | try { |
| 56 | const temp_sites = sites.filter(site => site.selected === 'true') |
| 57 | if (temp_sites.length > 0) { |
| 58 | await temp_sites.forEach(site => { |
| 59 | if (site.detections.length > 0 && !helper.global_lock.includes(req.body.uuid)) { |
| 60 | functions.push(find_username_site.bind(null, req.body.uuid, req.body.string, req.body.option, site)) |
| 61 | } |
| 62 | }) |
| 63 | const temp_results = await async.parallelLimit(functions, 15) |
| 64 | await temp_results.forEach(item => { |
| 65 | if (item !== undefined) { |
| 66 | if (item.return === 1) { |
| 67 | results.push(item.profile) |
| 68 | } else { |
| 69 | helper.log_to_file_queue(req.body.uuid, '[Waiting to retry] ' + helper.get_site_from_url(item.site.url)) |
| 70 | re_try.push(item.site) |
| 71 | } |
| 72 | } |
| 73 | }) |
| 74 | } |
| 75 | } catch (err) { |
| 76 | helper.verbose && console.log(err) |
| 77 | } |
| 78 | return [re_try, results] |
| 79 | } |
| 80 | |
| 81 | async function find_username_site (uuid, username, options, site) { |
| 82 | return new Promise(async (resolve, reject) => { |
no outgoing calls
no test coverage detected