Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25519

cleanupversions does not scale

    XMLWordPrintable

    Details

      Description

      If, for some reason (for instance in result of script execution failure due to EZP-21840), cleanup old versions of content does not run for sometime, one can end up in a scenario where there are more old versions that the legacy cleanupversions script can handle.

      steps to reproduce
      • create an image object
      • edit and publish this object many times (say 1000, use the command below if needed)
      • setup [VersionManagement] DefaultVersionHistoryLimit=10
      • execute php ezpublish/console ezpublish:legacy:script bin/php/cleanupversions.php
        => the script will take too long to execute and fail due to database timeout
      create new versions command
          $repository = $this->getContainer()->get('ezpublish.api.repository');
          $repository->setCurrentUser($repository->getUserService()->loadUser(14));
          $contentService = $repository->getContentService();
          $contentInfo = $contentService->loadContentInfo(<your-image-object-id>);
          for ($f = 0; $f < 1200; $f++) {
            $contentDraft = $contentService->createContentDraft($contentInfo);
            $content = $contentService->publishVersion($contentDraft->versionInfo);
          }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              joaquim.cavalleri-obsolete@ez.no Joaquim Cavalleri (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: