diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Streamer.php | 13 | ||||
-rw-r--r-- | lib/private/User/DisplayNameCache.php | 6 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/private/Streamer.php b/lib/private/Streamer.php index de663f66e0d..e579c42c0d7 100644 --- a/lib/private/Streamer.php +++ b/lib/private/Streamer.php @@ -170,11 +170,16 @@ class Streamer { /** * Add an empty directory entry to the archive. * - * @param string $dirName Directory Path and name to be added to the archive. - * @return bool $success + * @param $dirName - Directory Path and name to be added to the archive. + * @param $timestamp - Modification time of the directory (defaults to current time) */ - public function addEmptyDir($dirName) { - return $this->streamerInstance->addEmptyDir($dirName); + public function addEmptyDir(string $dirName, int $timestamp = 0): bool { + $options = null; + if ($timestamp > 0) { + $options = ['timestamp' => $timestamp]; + } + + return $this->streamerInstance->addEmptyDir($dirName, $options); } /** diff --git a/lib/private/User/DisplayNameCache.php b/lib/private/User/DisplayNameCache.php index 40e1c752589..4321d95f88e 100644 --- a/lib/private/User/DisplayNameCache.php +++ b/lib/private/User/DisplayNameCache.php @@ -25,6 +25,8 @@ use OCP\User\Events\UserDeletedEvent; * @template-implements IEventListener<UserChangedEvent|UserDeletedEvent> */ class DisplayNameCache implements IEventListener { + private const CACHE_TTL = 24 * 60 * 60; // 1 day + private array $cache = []; private ICache $memCache; private IUserManager $userManager; @@ -56,7 +58,7 @@ class DisplayNameCache implements IEventListener { $displayName = null; } $this->cache[$userId] = $displayName; - $this->memCache->set($userId, $displayName, 60 * 10); // 10 minutes + $this->memCache->set($userId, $displayName, self::CACHE_TTL); return $displayName; } @@ -71,7 +73,7 @@ class DisplayNameCache implements IEventListener { $userId = $event->getUser()->getUID(); $newDisplayName = $event->getValue(); $this->cache[$userId] = $newDisplayName; - $this->memCache->set($userId, $newDisplayName, 60 * 10); // 10 minutes + $this->memCache->set($userId, $newDisplayName, self::CACHE_TTL); } if ($event instanceof UserDeletedEvent) { $userId = $event->getUser()->getUID(); |