Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Application extends App implements IBootstrap {
public const APP_ID = 'app_api';
public const TEST_DEPLOY_APPID = 'test-deploy';
public const TEST_DEPLOY_INFO_XML = 'https://raw.githubusercontent.com/nextcloud/test-deploy/main/appinfo/info.xml';
public const MINIMUM_HARP_VERSION = '0.3.0';
public const MINIMUM_HARP_VERSION = '0.4.8';

public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
Expand Down
7 changes: 4 additions & 3 deletions lib/SetupChecks/HarpVersionCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ private function fulfillsMinimumVersionRequirement(string $version): bool {
}

private function getHarpVersion(DaemonConfig $daemonConfig): ?string {
$cacheKey = $daemonConfig->getName() . '_' . (string)crc32(json_encode($daemonConfig));
// With the minimum in the key, a version cached against an older minimum is asked again.
$cacheKey = $daemonConfig->getName() . '_' . (string)crc32(json_encode($daemonConfig)) . '_' . Application::MINIMUM_HARP_VERSION;
$version = $this->cache?->get($cacheKey);
if ($version === null) {
$version = $this->harpService->getHarpVersion($daemonConfig);
$oneWeek = 60 * 60 * 24 * 7;
$this->cache?->set($cacheKey, $version, $oneWeek);
$ttl = $version !== null && $this->fulfillsMinimumVersionRequirement($version) ? 60 * 60 * 24 * 7 : 60 * 60;
$this->cache?->set($cacheKey, $version, $ttl);
}
return $version;
}
Expand Down
Loading