From bf565c3f3a5d59112794a9db994d00c9dc800f49 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 25 May 2007 18:33:59 +0000 Subject: [MRM-331]: Finding an Artifact gives an HTTP 500 git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@541744 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/scheduled/DefaultArchivaTaskScheduler.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'archiva-scheduled/src') diff --git a/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java b/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java index 083e9b07d..8d0e5690d 100644 --- a/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java +++ b/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java @@ -176,6 +176,15 @@ public class DefaultArchivaTaskScheduler dataMap.put( DatabaseTaskJob.TASK_QUEUE, databaseUpdateQueue ); databaseJob.setJobDataMap( dataMap ); + CronExpressionValidator cronValidator = new CronExpressionValidator(); + if ( !cronValidator.validate( cronString ) ) + { + getLogger().warn( + "Cron expression [" + cronString + + "] for database update is invalid. Defaulting to hourly." ); + cronString = CRON_HOURLY; + } + try { CronTrigger trigger = new CronTrigger( DATABASE_JOB_TRIGGER, DATABASE_SCAN_GROUP, cronString ); -- cgit v1.2.3