Commit graph

86 commits

Author SHA1 Message Date
Robin Appelman
914e8f9ce2 fix: misc code fixes around db sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-16 12:19:20 +02:00
Robin Appelman
8f57d46a0b fix: delay calculating global cache prefix untill a cache is created
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 14:54:14 +02:00
Robin Appelman
3e35e62f6b feat: add negative compare-and-delete to imemcache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-23 11:37:57 +00:00
Robin Appelman
cae0a8218d
chore: remove Redis::DEFAULT_TTL constant now that it's defined in the interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-07 19:41:44 +02:00
Robin Appelman
b19652a2ad
chore: cleanup acpu inc and dec
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-07 19:41:43 +02:00
Robin Appelman
cd9cc01b77
fix: set default TTL for APCu cache as per docs
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-07 19:41:41 +02:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Velwark
535d5de037 Update LoggerWrapperCache.php
Extra Dollar Sign caused errors in Nextcloud. Removing the Dollar Sign Solved the Problem.

Signed-off-by: Velwark <levinfrerich9@gmail.com>
2024-04-23 09:54:44 +02:00
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
Andrew Summers
c0f12d7691 Refactor OC\Server::getGetRedisFactory
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2024-03-15 13:11:40 +01:00
Robin Appelman
cc3c7c24a1 set a default and max ttl for redis keys
having infinite TTL can lead to leaked keys as the prefix changes with version upgrades

Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-02-23 15:41:51 +01:00
Côme Chilliet
f73f966c98 chore: Add missing ArrayAccess template parameters
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-06 10:24:41 +01:00
Robin Appelman
ff62154a79 adjust redis compareSetTTL to use a lua script
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-12-21 15:14:27 +01:00
Robin Appelman
7394645eb7 restore shared lock ttl when releasing
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-12-21 15:14:27 +01:00
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Christoph Wurst
ff672b11e2
feat: Add factory method for in-memory caches
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-10-11 13:37:22 +02:00
Christoph Wurst
fac05bce07
chore: Drop unused \OC\Memcache\Factory::createLowLatency
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-10-11 09:40:27 +02:00
Joas Schilling
93f0399a92
fix(memcache): Fix comparison of Memcache configs to classes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-08-16 16:05:50 +02:00
Daniel Kesselberg
7cab58237d chore: remove version check for apc extension
APC is gone since PHP 7.0.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-08-10 15:02:19 +02:00
Robin Appelman
9f1d497a0b
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in  lib/private to improve code readability.
2023-06-01 23:10:00 +02:00
Faraz Samapoor
e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +03:30
Varun Patil
c6cee282b3 redis: move lua scripts to class and add type hints
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2023-05-10 17:37:02 -07:00
Varun Patil
39e805fffa redis: use atomic operations everywhere
This removes a lot of acrobatics in the code and does each operation
atomically using a lua script. This also reduces several round trips
to the server, and the scripts are compiled and cached server-side.

Notably, since all operations work only on a single key (except clear,
which is broken anyway and shouldn't be used), they will continue to
function and be atomic for Redis cluster.

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2023-04-16 14:38:56 -07:00
Git'Fellow
c81ea3aa98
Fix RedisCluster
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-03-22 17:19:07 +01:00
Git'Fellow
fab390f884
Move from DEL to UNLINK
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-03-22 17:10:05 +01:00
Robin Appelman
853ec60f3e also cache backend for user in memory instead of always going to redis
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-10 12:25:23 +01:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Julius Härtl
023b80e617
Only setup redis connection if needed
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-11-22 09:26:24 +01:00
Côme Chilliet
826e234ecf
Correctly handle Redis::keys returning false
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-29 14:41:53 +02:00
Arthur Schiwon
90104bc1c4 memcached should not throw arbitrary exceptions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-06-17 18:32:14 +02:00
Carl Schwan
3f97bcdc75 Enable binary protocol again
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-17 17:24:24 +02:00
Carl Schwan
ba88187649 Add hit information to profiler
This might be helpful later on for the cache ui that is worked on in
https://github.com/nextcloud/profiler/pull/21

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-05 14:12:44 +02:00
Carl Schwan
7d272c54d0 Add a built-in profiler inside Nextcloud
The webui is provided by a seperate application named profiler

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-04 10:28:26 +02:00
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Carl Schwan
e3a12b3482
Fix psalm issues in theming app
After this change, we are down to only one psalm warning for this app
and related to the Application.php. This also make composer
psam:update-baseline not silently ignore new errors.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-26 14:26:58 +01:00
Côme Chilliet
36d7c73e69
Always call flush() as getAllKeys() is broken
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-20 11:20:18 +01:00
Carl Schwan
6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +01:00
Carl Schwan
aeecb72e96
Fix a few psalm issues and moved back to psalm/phar 4.18
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-12 20:03:06 +01:00
Carl Schwan
52760a95d9
Check if directoy is writable instead of possibly missing file
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-12-20 15:36:52 +01:00
Joas Schilling
168c673755
Allow to log DB, redis and LDAP requests into files
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 22:33:41 +01:00
Côme Chilliet
113756db30
Fix ArrayAccess and JsonSerializable return types
First round of modifications for PHP 8.1

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:28:56 +01:00
MichaIng
0304eea58d
Fix in locking cache check
The intention obviously was to check whether $lockingCacheClass is defined, and existing class, and available. It was however checked whether the $distributedCacheClass is an existing class, which would have caused an exception already in the previous distributed cache check.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-07-05 23:11:13 +02:00
Gary Kim
b78f3a57d1
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
2021-06-30 15:28:02 -04:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Richard Steinmetz
0f949eaeb1
Don't allow executing cli if cache backend is unavailable
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2021-05-26 11:02:26 +02:00
Arthur Schiwon
9f5480eef4
ensure redis returns bool for hasKey
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-04-13 23:07:54 +02:00
Christoph Wurst
0c5adaddf8
Drop \OC\Memcache\Factory::create
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-16 11:43:05 +01:00
Roeland Jago Douma
4f0fae8f00
Actually set the TTL on redis set
Else well the keys remain for ever and ever.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-12-21 13:33:16 +01:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +02:00