Azure-functions-host: Support for Quartz cron expressions

Created on 4 May 2016  路  2Comments  路  Source: Azure/azure-functions-host

Quartz cron expressions are failing with a message that is not clear.

Error:

Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.Timer'. mscorlib: String was not recognized as a valid TimeSpan.

Quartz cron expression used (run every day at midnight):

0 0 0 1/1 * ? *

Expression build with http://www.cronmaker.com/

Most helpful comment

We use the NCronTab library, and we use the 6 field format. The expression you give above has 7 fields so is invalid. See the NCronTab documentation for more information.

The reason you're getting that error message is because we first try to parse as a cron expression, then fall back to trying to parse as a TimeSpan. I agree that error message can be improved, and I logged an issue for that here.

All 2 comments

We use the NCronTab library, and we use the 6 field format. The expression you give above has 7 fields so is invalid. See the NCronTab documentation for more information.

The reason you're getting that error message is because we first try to parse as a cron expression, then fall back to trying to parse as a TimeSpan. I agree that error message can be improved, and I logged an issue for that here.

Was this page helpful?
0 / 5 - 0 ratings