* EchoEvent now supports `extra` params for job delay and deduplication
* When Echo identifies this type of param it creates a
DelayedEchoNotificationJob that will be executed after `delay` seconds
Change-Id: Ib0c6789dfe42e9703a67835909e5932c0054089f
EventMapper->fetchById() has retry on master built-in but it doesn't
kick in in a Job because the load balancer is a new instance and doesn't
know about previous writes.
This change makes the job always read from master to make
sure the event is found. It is going to write to master
right after anyway.
Bug: T204894
Change-Id: I9a2873234f1dd5416e6c2bedeb904880d1f79562
Also test it more meaningfully by setting up a mock database and
asserting that the right DELETE queries are issued.
Change-Id: Id39723b92118e98d9c9f0cd7381e9396dce67c17
The `DBMasterPos` class is not JSON-serializable, so
we can not transfer the job in the kafka-based queue.
Before, we were waiting for slaves before executing the
job till the point in time when the job was submitted,
now we will just wait for slaves till the point in time
the job was executed. That lets up not to include the
database master position in the event and make it serializable.
Bug: T192945
Change-Id: I7c754bd1e899bad030cc6434be19daf2542e015f
We almost always call it with DB_MASTER, and I'm pretty sure that the
one call that uses DB_REPLICA introduces a race condition. I didn't want
to change that quite yet, though, so I left it in for now.
Change-Id: Ia5a59fdda357b799e327b8ed224f3ccb09509a8a
NotificationJob used to include an instance
of EchoEvent, which is not serializable.
With this change, it only includes the
event Id (int) and retrieve the event
instance in its run() function.
Bug: T192945
Change-Id: I00950ddfa37717c7dfc19efdca9701693622da5d
Target page entries used to exist for each user
that was notified for an event. They were
removed as the notifications were marked as read.
Now they remain so that the association between
pages and events can be used for moderation
regardless of the notifications read status.
This patch removes everything about
echo_target_page.etp_user from sql and php code.
Bug: T143959
Change-Id: Ib57510e6b0e9202a7e035f8ea59955dca8a0b24a
Old jobs were queued with array( $userId => $userId ), so there will be no
'0' index. Use array_values() since we don't care about the keys.
Change-Id: I1155d310c7fa09c728797d35d63c7cec0383511c
EchoNotificationDeleteJob now only processes one user at a time. If
given multiple user ids, it will queue individual jobs for each user id
rather than processing many at once.
Bug: T102574
Change-Id: I627f059280d8fab3854d9ca8417f22179478772c