mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
[DSC-93] Added help to ProcessCleaner
This commit is contained in:
@@ -34,17 +34,18 @@ import org.dspace.utils.DSpace;
|
|||||||
*/
|
*/
|
||||||
public class ProcessCleaner extends DSpaceRunnable<ProcessCleanerConfiguration<ProcessCleaner>> {
|
public class ProcessCleaner extends DSpaceRunnable<ProcessCleanerConfiguration<ProcessCleaner>> {
|
||||||
|
|
||||||
|
|
||||||
private ConfigurationService configurationService;
|
private ConfigurationService configurationService;
|
||||||
|
|
||||||
private ProcessService processService;
|
private ProcessService processService;
|
||||||
|
|
||||||
|
|
||||||
boolean cleanCompleted = false;
|
private boolean cleanCompleted = false;
|
||||||
|
|
||||||
boolean cleanFailed = false;
|
private boolean cleanFailed = false;
|
||||||
|
|
||||||
boolean cleanRunning = false;
|
private boolean cleanRunning = false;
|
||||||
|
|
||||||
|
private boolean help = false;
|
||||||
|
|
||||||
private Integer days;
|
private Integer days;
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ public class ProcessCleaner extends DSpaceRunnable<ProcessCleanerConfiguration<P
|
|||||||
this.configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
this.configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||||
this.processService = ScriptServiceFactory.getInstance().getProcessService();
|
this.processService = ScriptServiceFactory.getInstance().getProcessService();
|
||||||
|
|
||||||
|
this.help = commandLine.hasOption('h');
|
||||||
this.cleanFailed = commandLine.hasOption('f');
|
this.cleanFailed = commandLine.hasOption('f');
|
||||||
this.cleanRunning = commandLine.hasOption('r');
|
this.cleanRunning = commandLine.hasOption('r');
|
||||||
this.cleanCompleted = commandLine.hasOption('c') || (!cleanFailed && !cleanRunning);
|
this.cleanCompleted = commandLine.hasOption('c') || (!cleanFailed && !cleanRunning);
|
||||||
@@ -70,6 +72,11 @@ public class ProcessCleaner extends DSpaceRunnable<ProcessCleanerConfiguration<P
|
|||||||
@Override
|
@Override
|
||||||
public void internalRun() throws Exception {
|
public void internalRun() throws Exception {
|
||||||
|
|
||||||
|
if (help) {
|
||||||
|
printHelp();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -40,6 +40,8 @@ public class ProcessCleanerConfiguration<T extends ProcessCleaner> extends Scrip
|
|||||||
|
|
||||||
Options options = new Options();
|
Options options = new Options();
|
||||||
|
|
||||||
|
options.addOption("h", "help", false, "help");
|
||||||
|
|
||||||
options.addOption("r", "running", false, "delete the process with RUNNING status");
|
options.addOption("r", "running", false, "delete the process with RUNNING status");
|
||||||
options.getOption("r").setType(boolean.class);
|
options.getOption("r").setType(boolean.class);
|
||||||
|
|
||||||
|
@@ -1542,6 +1542,10 @@ solr-database-resync.time-until-reindex = 600000
|
|||||||
# Keep in mind, changing the schedule requires rebooting your servlet container, e.g. Tomcat.
|
# Keep in mind, changing the schedule requires rebooting your servlet container, e.g. Tomcat.
|
||||||
solr-database-resync.cron = 0 15 2 * * ?
|
solr-database-resync.cron = 0 15 2 * * ?
|
||||||
|
|
||||||
|
## PROCESS CLEANER SCRIPT
|
||||||
|
# Defines how many days to go back from the current date to find out which old processes to delete (default is 14)
|
||||||
|
# process-cleaner.days = 14
|
||||||
|
|
||||||
#------------------------------------------------------------------#
|
#------------------------------------------------------------------#
|
||||||
#-------------------MODULE CONFIGURATIONS--------------------------#
|
#-------------------MODULE CONFIGURATIONS--------------------------#
|
||||||
#------------------------------------------------------------------#
|
#------------------------------------------------------------------#
|
||||||
|
Reference in New Issue
Block a user