-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalised first and lasted edited time to use revisions #854
Conversation
This commit calculates the last edited time using a similar methodology to the existing on to calculated first edited time. It uses the `allrevisions` list. This method will exclude all revisions created by the PlatformReservedUser. This means that it will erroneously ignore revisions from importing entities. Bug: T364991
bc49f40
to
93e9f05
Compare
public function up(): void | ||
{ | ||
WikiLifecycleEvents::all()->map->delete(); | ||
(new UpdateWikiSiteStatsJob())->handle(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this run synchronously and waits until all jobs for all wikis are finished or will it just dispatch a set of jobs into the queue and then move on? Asking because I would think calling handle
on a job is a wee bit of an anti pattern, but maybe we just need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this run synchronously and waits until all jobs for all wikis are finished
It does this exactly; runs them synchronously and if they fail the migration will fail. You think it would be better to just dispatch it to the queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think that the migration runs in a transaction, and this means we have a transaction open for a very long time. But maybe that's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I would guess it be open for best part of a minute+. I've made the job dispatchable and instead dispatched it.
To paste from my local setup this of 50 Wikis from ~10s to 32ms to run the migration
This commit calculates the last edited time using a similar methodology to the existing on to calculated first edited time. It uses the
allrevisions
list.This method will exclude all revisions created by the PlatformReservedUser. This means that it will erroneously ignore revisions from importing entities.
Bug: T364991