mirror of https://github.com/apache/archiva.git
[MRM-1632] Invalid Cron in a job means webapp will not start
If syntax is invalid, log a warning instead of throwing the exception, and the job will not be scheduled. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1348883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f50378e6e
commit
ced2e45916
|
@ -190,9 +190,17 @@ public class DefaultDownloadRemoteIndexScheduler
|
|||
{
|
||||
log.info( "schedule download remote index for repository {} with cron expression {}",
|
||||
remoteRepository.getId(), remoteRepository.getCronExpression() );
|
||||
taskScheduler.schedule(
|
||||
new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
|
||||
new CronTrigger( remoteRepository.getCronExpression() ) );
|
||||
try
|
||||
{
|
||||
CronTrigger cronTrigger = new CronTrigger( remoteRepository.getCronExpression() );
|
||||
taskScheduler.schedule(
|
||||
new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
|
||||
cronTrigger );
|
||||
}
|
||||
catch ( IllegalArgumentException e )
|
||||
{
|
||||
log.warn( "Unable to schedule remote index download: " + e.getLocalizedMessage() );
|
||||
}
|
||||
|
||||
if ( remoteRepository.isDownloadRemoteIndexOnStartup() )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue