Configure EXT:scheduler table garbage collection (#102)

Add configuration to clean up garbage of old import records.

Relates: #10244
This commit is contained in:
Daniel Siepmann 2023-01-03 10:42:33 +01:00 committed by GitHub
parent f41b8448c5
commit d9a7153c05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View file

@ -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

View file

@ -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);