File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ object = if uri\match "^/manifests"
3434 INNER JOIN modules
3535 ON (modules.id = module_id and modules.user_id = ?)
3636 WHERE rockspec_fname = ?
37+ ORDER BY modules.id ASC
38+ LIMIT 1
3739 ]] , user. id, file
3840 else
3941 unpack Rocks \ select [[
@@ -42,6 +44,8 @@ object = if uri\match "^/manifests"
4244 INNER JOIN modules
4345 ON (modules.id = versions.module_id and modules.user_id = ?)
4446 WHERE rock_fname = ?
47+ ORDER BY modules.id ASC
48+ LIMIT 1
4549 ]] , user. id, file
4650
4751else
5559 -- TODO: this query is pretty nasty to do on every file request
5660 if is_rockspec!
5761 unpack Versions \ select [[
62+ INNER JOIN modules
63+ ON (modules.id = versions.module_id)
5864 INNER JOIN manifest_modules
5965 ON (manifest_modules.module_id = versions.module_id and manifest_modules.manifest_id = ?)
6066 WHERE rockspec_fname = ?
67+ ORDER BY modules.id ASC
68+ LIMIT 1
6169 ]] , manifest. id, file_name
6270 else
6371 unpack Rocks \ select [[
6472 INNER JOIN versions
6573 ON (versions.id = rocks.version_id)
74+ INNER JOIN modules
75+ ON (modules.id = versions.module_id)
6676 INNER JOIN manifest_modules
6777 ON (manifest_modules.module_id = versions.module_id and manifest_modules.manifest_id = ?)
6878 WHERE rock_fname = ?
79+ ORDER BY modules.id ASC
80+ LIMIT 1
6981 ]] , manifest. id, file_name
7082
7183assert object
@@ -87,4 +99,3 @@ if object.content_type
8799
88100ngx. header[ " x-object_url" ] = url
89101ngx. var. _url = url
90-
You can’t perform that action at this time.
0 commit comments