From d9a7153c0581572b6b0a7486a4c04b1778f08ee0 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 3 Jan 2023 10:42:33 +0100 Subject: [PATCH] Configure EXT:scheduler table garbage collection (#102) Add configuration to clean up garbage of old import records. Relates: #10244 --- Documentation/Changelog/1.3.1.rst | 29 +++++++++++++++++++++++++++++ ext_localconf.php | 12 ++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Documentation/Changelog/1.3.1.rst diff --git a/Documentation/Changelog/1.3.1.rst b/Documentation/Changelog/1.3.1.rst new file mode 100644 index 0000000..4443360 --- /dev/null +++ b/Documentation/Changelog/1.3.1.rst @@ -0,0 +1,29 @@ +1.3.1 +===== + +Breaking +-------- + +Nothing + +Features +-------- + +* Configure EXT:scheduler table garbage collection task to clean up import records. + It is now possible to select the tables within the TYPO3 scheduler task to be cleaned up. + +Fixes +----- + +Nothing + +Tasks +----- + +Nothing + +Deprecation +----------- + +Nothing + diff --git a/ext_localconf.php b/ext_localconf.php index e5161d9..c2e0ddb 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -8,4 +8,16 @@ defined('TYPO3') or die(); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup( '@import "EXT:' . $extensionKey . '/Configuration/TypoScript/Default/Setup.typoscript"' ); + + $tablesForCleanup = [ + 'tx_thuecat_import_log', + 'tx_thuecat_import_log_entry', + ]; + + foreach ($tablesForCleanup as $tableName) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables'][$tableName] = [ + 'dateField' => 'crdate', + 'expirePeriod' => '180', + ]; + } })(\WerkraumMedia\ThueCat\Extension::EXTENSION_KEY);