mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Make package details cache TTL configurable
The TTL for package details can be much longer than for generic values since they never change. Note that when an update is pushed via Git, all packages belonging to that package base are deleted and new packages are created. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
f804ea4abb
commit
734527370d
3 changed files with 15 additions and 7 deletions
|
@ -292,7 +292,8 @@ class AurJSON {
|
|||
"FROM Licenses INNER JOIN PackageLicenses " .
|
||||
"ON PackageLicenses.PackageID = " . $pkgid . " " .
|
||||
"AND PackageLicenses.LicenseID = Licenses.ID";
|
||||
$rows = db_cache_result($query, 'extended-fields:' . $pkgid, PDO::FETCH_ASSOC);
|
||||
$ttl = config_get_int('options', 'cache_pkginfo_ttl');
|
||||
$rows = db_cache_result($query, 'extended-fields:' . $pkgid, PDO::FETCH_ASSOC, $ttl);
|
||||
|
||||
$type_map = array(
|
||||
'depends' => 'Depends',
|
||||
|
@ -315,7 +316,8 @@ class AurJSON {
|
|||
$query = "SELECT Keyword FROM PackageKeywords " .
|
||||
"WHERE PackageBaseID = " . intval($base_id) . " " .
|
||||
"ORDER BY Keyword ASC";
|
||||
$rows = db_cache_result($query, 'keywords:' . intval($base_id));
|
||||
$ttl = config_get_int('options', 'cache_pkginfo_ttl');
|
||||
$rows = db_cache_result($query, 'keywords:' . intval($base_id), PDO::FETCH_NUM, $ttl);
|
||||
$data['Keywords'] = array_map(function ($x) { return $x[0]; }, $rows);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue