Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
1d86b3e2
Verified
Commit
1d86b3e2
authored
Feb 18, 2022
by
Kevin Morris
Browse files
fix: use a transaction for package query; remove refresh
Closes #284 Signed-off-by:
Kevin Morris
<
kevr@0cost.org
>
parent
4e641d94
Pipeline
#15996
passed with stages
in 3 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
aurweb/packages/util.py
View file @
1d86b3e2
...
...
@@ -138,20 +138,20 @@ def updated_packages(limit: int = 0,
# If we already have a cache, deserialize it and return.
return
orjson
.
loads
(
packages
)
query
=
db
.
query
(
models
.
Package
).
join
(
models
.
PackageBase
).
filter
(
models
.
PackageBase
.
PackagerUID
.
isnot
(
None
)
).
order_by
(
models
.
PackageBase
.
ModifiedTS
.
desc
()
)
with
db
.
begin
():
query
=
db
.
query
(
models
.
Package
).
join
(
models
.
PackageBase
).
filter
(
models
.
PackageBase
.
PackagerUID
.
isnot
(
None
)
).
order_by
(
models
.
PackageBase
.
ModifiedTS
.
desc
()
)
if
limit
:
query
=
query
.
limit
(
limit
)
if
limit
:
query
=
query
.
limit
(
limit
)
packages
=
[]
for
pkg
in
query
:
# For each Package returned by the query, append a dict
# containing Package columns we're interested in.
db
.
refresh
(
pkg
)
packages
.
append
({
"Name"
:
pkg
.
Name
,
"Version"
:
pkg
.
Version
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment