Skip to content

Commit

Permalink
Do not search across everywhere anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jul 19, 2024
1 parent e825b8b commit 2290de3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ function mongo_package_info(package, universe){
throw createError(404, `Package ${package} failed to build: ${pkgdata._buildurl}`)
return pkgdata;
} else {
// Try to find pkg elsewhere...
// Try to find pkg elsewhere (nb regex search is slow)
var altquery = {
_type: 'src',
Package : {$regex: `^${package}$`, $options: 'i'},
'$or' : [{'_universes': universe, _registered: true}, {'_indexed': true}]
_universes: universe,
_registered: true
}
return mongo_find(altquery).next().then(function(alt){
if(alt){
Expand Down

0 comments on commit 2290de3

Please sign in to comment.