Skip to content

Commit

Permalink
pkp/pkp-lib#8306 Failed job enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Feb 15, 2023
1 parent dc76e7d commit baa5ff2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
19 changes: 19 additions & 0 deletions api/v1/jobs/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @defgroup api_v1_jobs Queue Jobs API requests
*/

/**
* @file api/v1/jobs/index.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup api_v1_users
* @brief Handle requests for Queue Jobs API functions.
*
*/

return new \PKP\API\v1\jobs\PKPJobHandler();
4 changes: 4 additions & 0 deletions config.TEMPLATE.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,7 @@
; When setting a fixed value in megabytes, this should be less than the
; memory_limit the server has configured for PHP.
job_runner_max_memory = 80

; Remove failed jobs from the database after the following number of days.
; Remove this setting to leave failed jobs in the database.
delete_failed_jobs_after = 180
4 changes: 4 additions & 0 deletions js/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import StatsUsersPage from '@/components/Container/StatsUsersPage.vue';
import SubmissionWizardPage from '@/components/Container/SubmissionWizardPage.vue';
import WorkflowPage from '@/components/Container/WorkflowPageOJS.vue';
import JobsPage from '@/components/Container/JobsPage.vue';
import FailedJobsPage from '@/components/Container/FailedJobsPage.vue';
import FailedJobDetailsPage from '@/components/Container/FailedJobDetailsPage.vue';

// Required by the URN plugin
import FieldText from '@/components/Form/fields/FieldText.vue';
Expand All @@ -46,6 +48,8 @@ window.pkp = Object.assign(PkpLoad, {
ImportExportPage,
ManageEmailsPage,
JobsPage,
FailedJobsPage,
FailedJobDetailsPage,
Page,
SettingsPage,
StartSubmissionPage,
Expand Down
4 changes: 4 additions & 0 deletions registry/scheduledTasks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@
<descr>Process pending queue jobs in the default queue driver and queue</descr>
<frequency second="0"/>
</task>
<task class="PKP\task\RemoveFailedJobs">
<descr>Automatically remove jobs that failed more than X days ago. The time limit can be changed in the the delete_failed_jobs_after setting in the config file.</descr>
<frequency day="1"/>
</task>
</scheduled_tasks>

0 comments on commit baa5ff2

Please sign in to comment.