nextcloud/tests/lib
Christoph Wurst 4e41638101 Prevent duplicate auth token activity updates
The auth token activity logic works as follows
* Read auth token
* Compare last activity time stamp to current time
* Update auth token activity if it's older than x seconds

This works fine in isolation but with concurrency that means that
occasionally the same token is read simultaneously by two processes and
both of these processes will trigger an update of the same row.
Affectively the second update doesn't add much value. It might set the
time stamp to the exact same time stamp or one a few seconds later. But
the last activity is no precise science, we don't need this accuracy.

This patch changes the UPDATE query to include the expected value in a
comparison with the current data. This results in an affected row when
the data in the DB still has an old time stamp, but won't affect a row
if the time stamp is (nearly) up to date.

This is a micro optimization and will possibly not show any significant
performance improvement. Yet in setups with a DB cluster it means that
the write node has to send fewer changes to the read nodes due to the
lower number of actual changes.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-22 09:16:05 +00:00
..
Accounts implement verification for additional mails 2021-09-10 13:17:39 +02:00
Activity Fix activity tests again 2020-08-18 18:21:03 +02:00
App Fix unit tests 2021-04-27 14:34:32 +02:00
AppFramework Move DateTime::RFC2822 to DateTimeInterface::2822 2021-06-23 15:30:43 +02:00
Archive Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
Authentication Prevent duplicate auth token activity updates 2021-10-22 09:16:05 +00:00
Avatar Fix unit tests 2021-04-27 14:34:32 +02:00
BackgroundJob Remove getLastJob from IJobList 2020-08-13 21:50:06 +02:00
Cache Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
Calendar Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Collaboration Fix warnings about logException 2021-06-04 10:57:09 +02:00
Command Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Comments Fix unit tests 2021-02-06 13:07:06 +01:00
Contacts/ContactsMenu Add email addresses to contacts menu 2021-09-17 10:04:22 +02:00
DB Add a unit test to check for casting a IQueryFunction 2021-09-24 20:20:02 +00:00
Diagnostics Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
DirectEditing Get the parent directory before creating a file from a template 2021-04-01 13:48:21 +02:00
Encryption Log and continue when failing to update encryption keys during for individual files 2021-03-19 14:12:07 +01:00
EventDispatcher Fix the legacy dispatcher argument order 2021-02-09 10:47:14 +01:00
Federation set the display name of federated sharees from addressbook 2020-11-24 11:30:11 +01:00
Files explicitly close source stream on local storage 2021-10-08 08:04:34 +00:00
GlobalScale Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Group Fix types in the Group Manager 2021-03-03 14:52:47 +01:00
Hooks Remove unused private ForwardEmitter and LegacyEmitter 2020-10-28 22:23:39 +01:00
Http Adjust test 2021-04-06 11:37:47 +00:00
IntegrityCheck Cleanup the constructor 2021-01-18 11:32:50 +01:00
L10N Correctly replace all PHP placeholders with the parameters 2021-04-20 16:42:05 +02:00
Lock Bump doctrine/dbal from 2.12.0 to 3.0.0 2021-01-08 11:45:19 +01:00
Lockdown Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
Log Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Mail Set local domain for swiftmailer transport 2021-05-31 15:04:00 +02:00
Memcache Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
Migration Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Notification Allow registering NotifierServices trough IBootstrap 2021-04-16 13:56:28 +02:00
OCS Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Preview Skip the test if Imagick is misconfigured 2020-12-09 09:07:20 +01:00
PublicNamespace Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
Remote Use exactly one empty line after the namespace declaration 2020-04-09 11:48:10 +02:00
Repair test: adjust expectation 2021-01-29 19:32:12 +01:00
RichObjectStrings Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
Route Only load routes of the app which is requested 2020-08-19 21:58:20 +02:00
Security Add database ratelimiting backend 2021-09-13 15:36:07 +02:00
Session Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Settings Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
Share Re-use fetched dependencies in lib/base.php 2021-01-20 21:55:16 +01:00
Share20 Admin Audit - Sharing: createShare - report the full path 2021-07-26 11:29:41 +00:00
Support Fix support tests 2021-04-20 17:36:15 +02:00
SystemTag Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
Template Bump scssphp/scssphp from 1.0.3 to 1.4.0 2021-01-11 12:41:25 +01:00
Traits php cs fix 2020-12-07 15:44:04 +01:00
Updater Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
User enable the user to set a primary (notification) email address (backend) 2021-09-10 13:22:26 +02:00
Util Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
AllConfigTest.php use specific email getter where necessary 2021-09-10 13:22:27 +02:00
APITest.php Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
AppConfigTest.php Bump doctrine/dbal from 2.12.0 to 3.0.0 2021-01-08 11:45:19 +01:00
AppTest.php Fix unit tests 2021-04-27 14:34:32 +02:00
AutoLoaderTest.php Remove trailing and in between spaces 2020-04-09 16:07:47 +02:00
CapabilitiesManagerTest.php Fix warnings about logException 2021-06-04 10:57:09 +02:00
ConfigTest.php Fix tests 2020-11-06 09:37:45 +01:00
ContactsManagerTest.php Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
DateTimeFormatterTest.php Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
ErrorHandlerTest.php Cleaner removePassword regex 2021-03-27 18:42:58 +01:00
FileChunkingTest.php Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
HelperStorageTest.php Add visibility to all methods and position of static keyword 2020-04-10 16:51:06 +02:00
HookHelper.php Use the short array syntax, everywhere 2020-03-26 16:34:56 +01:00
ImageTest.php php cs fix 2020-12-07 15:44:04 +01:00
InfoXmlTest.php Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
InitialStateServiceTest.php Fix unit tests 2021-04-27 14:34:32 +02:00
InstallerTest.php Fix unit tests 2021-04-27 14:34:32 +02:00
LargeFileHelperGetFileSizeTest.php Make sure we can also run with escapedshell args 2020-12-07 15:44:04 +01:00
LargeFileHelperTest.php Mode to modern phpunit 2019-11-27 15:27:18 +01:00
LegacyHelperTest.php Rewrite LegacyHelperTest without $this->at() 2021-06-07 21:43:30 +02:00
LoggerTest.php Format code to a single space around binary operators 2020-10-05 20:25:24 +02:00
MemoryInfoTest.php Let memory limit set in tests fit the used amount 2021-07-22 16:41:44 +00:00
NaturalSortTest.php Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
NavigationManagerTest.php Let apps toggle an unread counter on app icons 2021-06-16 17:12:56 +02:00
RepairStepTest.php log full expection during repair step 2021-03-18 08:45:17 +01:00
ServerTest.php Bump doctrine/dbal from 2.12.0 to 3.0.0 2021-01-08 11:45:19 +01:00
SetupTest.php Fix unit tests 2021-04-27 14:34:32 +02:00
SubAdminTest.php Change tests to typed event listener 2020-10-28 23:10:23 +01:00
TagsTest.php Make sure getUsersFavoritingObject can be run without a user 2020-10-06 16:49:23 +02:00
TemplateFunctionsTest.php Format control structures, classes, methods and function 2020-04-10 14:19:56 +02:00
TempManagerTest.php Remove unneeded import 2020-08-20 16:53:34 +02:00
TestCase.php Make Testcase class compatible with phpunit-9.5 2021-03-29 09:43:08 +02:00
TestMoveableMountPoint.php Move tests/ to PSR-4 (#24731) 2016-05-20 15:38:20 +02:00
UpdaterTest.php Fix unit tests 2021-04-27 14:34:32 +02:00
UrlGeneratorTest.php Use IURLGenerator function to get value of \OC::$WEBROOT global 2021-08-16 13:12:00 +00:00
UtilCheckServerTest.php Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject 2020-08-12 13:55:19 +02:00
UtilTest.php load share settings from the share manager in more places 2021-05-12 16:11:28 +02:00