mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: use a transaction for package query; remove refresh
Closes #284 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4e641d945c
commit
1d86b3e210
1 changed files with 8 additions and 8 deletions
|
@ -138,6 +138,7 @@ def updated_packages(limit: int = 0,
|
|||
# If we already have a cache, deserialize it and return.
|
||||
return orjson.loads(packages)
|
||||
|
||||
with db.begin():
|
||||
query = db.query(models.Package).join(models.PackageBase).filter(
|
||||
models.PackageBase.PackagerUID.isnot(None)
|
||||
).order_by(
|
||||
|
@ -151,7 +152,6 @@ def updated_packages(limit: int = 0,
|
|||
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,
|
||||
|
|
Loading…
Add table
Reference in a new issue