[Feature] Add definitionModificationDate to classes table to optimize rebuild command performance#15383
Conversation
Review Checklist
|
| if ($saveDefinitionFile) { | ||
| $this->setModificationDate(time()); | ||
| } |
There was a problem hiding this comment.
May this have any side effects? Why the modification date was previously updated, if the definition file is not saved anyways?
andreas-gruenwald
left a comment
There was a problem hiding this comment.
See comments.
Please create a PR for Pimcore 11, as it won't be accepted for Pimcore 10 anymore.
e3e2032 to
e851d01
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
|
@brusch fyi |
# Conflicts: # bundles/CoreBundle/src/Command/ClassesRebuildCommand.php # lib/Model/DataObject/ClassDefinition/ClassDefinitionManager.php
|
@jremmurd I'm thinking of the following scenario:
I think we should have at least a "force" argument to rebuild all classes. |
|
@jremmurd Ah, you save the modificationDate and not the current date in the lastRebuildDate column. This should work for the scenario. But then I think the name of the column is misleading. |
@blankse Good point, the column name could really be misleading. What about I'll also add the |
|
@jremmurd I would prefer |
19eea61 to
276fcbc
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
|
@jremmurd Could you please merge 11.x in your PR to resolve the conflicts? Thanks |
|
@jremmurd 🏓😊 Thanks! |
…a_back # Conflicts: # lib/Model/DataObject/ClassDefinition/ClassDefinitionManager.php
@robertSt7 done 🔢 |
|
@jremmurd thank you 👍 |











Add
lastRebuildDatetoclassestable to optimize performance ofbin/console pimcore:deployment:classes-rebuildcommand.With this change the command only updates the db, if the modification date of the definition file differs from the saved timestamp in the classes table in the db.
If the modificationDate is the same in the db as in the definition file, the verbose output says, that saving the definition was skipped:
This change reduces the execution time from about 120s to 15-25s on AWS, if no class definition was updated. Which for us directly affects the downtown during deployments.
(only tested in Pimcore 10)