mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 22:13:08 +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>> {
|
||||
|
||||
|
||||
private ConfigurationService configurationService;
|
||||
|
||||
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;
|
||||
|
||||
@@ -55,6 +56,7 @@ public class ProcessCleaner extends DSpaceRunnable<ProcessCleanerConfiguration<P
|
||||
this.configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
this.processService = ScriptServiceFactory.getInstance().getProcessService();
|
||||
|
||||
this.help = commandLine.hasOption('h');
|
||||
this.cleanFailed = commandLine.hasOption('f');
|
||||
this.cleanRunning = commandLine.hasOption('r');
|
||||
this.cleanCompleted = commandLine.hasOption('c') || (!cleanFailed && !cleanRunning);
|
||||
@@ -70,6 +72,11 @@ public class ProcessCleaner extends DSpaceRunnable<ProcessCleanerConfiguration<P
|
||||
@Override
|
||||
public void internalRun() throws Exception {
|
||||
|
||||
if (help) {
|
||||
printHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
Context context = new Context();
|
||||
|
||||
try {
|
||||
|
@@ -40,6 +40,8 @@ public class ProcessCleanerConfiguration<T extends ProcessCleaner> extends Scrip
|
||||
|
||||
Options options = new Options();
|
||||
|
||||
options.addOption("h", "help", false, "help");
|
||||
|
||||
options.addOption("r", "running", false, "delete the process with RUNNING status");
|
||||
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.
|
||||
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--------------------------#
|
||||
#------------------------------------------------------------------#
|
||||
|
Reference in New Issue
Block a user