[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
jurnal-kesmas
/
v1
/
lib
/
pkp
/
classes
/
task
/
[
Home
]
File: RemoveFailedJobs.php
<?php /** * @file classes/task/RemoveFailedJobs.php * * Copyright (c) 2022 Simon Fraser University * Copyright (c) 2022 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @class RemoveFailedJobs * * @ingroup tasks * * @brief Remove the much older failed jobs form the failed list */ namespace PKP\task; use Carbon\Carbon; use PKP\config\Config; use PKP\scheduledTask\ScheduledTask; class RemoveFailedJobs extends ScheduledTask { /** * @copydoc ScheduledTask::getName() */ public function getName() { return __('admin.scheduledTask.removeFailedJobs'); } /** * @copydoc ScheduledTask::executeActions() */ public function executeActions() { $cleanUpPeriod = (int) Config::getVar('queues', 'delete_failed_jobs_after', null); // No need to run the clean up process if the cleaning period is not defined in config if (!$cleanUpPeriod) { return true; } app('queue.failer')->prune(Carbon::now()->subDays($cleanUpPeriod)->startOfDay()); return true; } }