WatchedItemStore: Use batching in setNotificationTimestampsForUser
authorRoan Kattouw <roan.kattouw@gmail.com>
Wed, 16 Jan 2019 21:51:54 +0000 (13:51 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 21 Mar 2019 04:41:42 +0000 (04:41 +0000)
commit1da7573bb77beff9e4466430b57551986e6be248
tree9b557cae9d56180de264bf80df83464f6c452b60
parentc4124a2625e7f2589f00f5c567e7098057d95348
WatchedItemStore: Use batching in setNotificationTimestampsForUser

Update rows in batches, using the same logic as is used by
removeWatchBatchForUser().

Also remove the functionality for updating all rows, and move that to
resetAllNotificationTimestampsForUser() instead. To that end, add a
timestamp parameter to that method and to the job it uses, and make
setNotificationTimestampsForUser() behave like a backwards-compatibility
wrapper around resetAllNotificationTimestampsForUser() when no list of
titles is specified.

Bug: T207941
Change-Id: I58342257395de6fcfb4c392b3945b12883ca1680
Follows-Up: I2008ff89c95fe6f66a3fd789d2cef0e8fe52bd93
includes/api/ApiSetNotificationTimestamp.php
includes/jobqueue/jobs/ClearWatchlistNotificationsJob.php
includes/watcheditem/WatchedItemStore.php
tests/phpunit/includes/watcheditem/WatchedItemStoreIntegrationTest.php
tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php