Jump to content
Izu

API Scheduler - running the utility has no effect

Recommended Posts

We have executed the API Scheduler with the '-dryrun' parameter set to 'true' and 'false' as well with no error messages. My colleague who carried out the necessary checks indicated that she does not think it worked.

Furthermore; The scheduled task that was set up to run the utility never stops running hence every time I execute the task; I always manually end the task else it runs indefinitely.

Share this post


Link to post
Share on other sites

Hi @Izu,

The API Scheduler is a self-contained scheduler utility, hence it running indefinitely. Its purpose is not to make one-off API calls, but to make API calls as part of a CRON schedule, so it's entirely possible that the schedule hasn't reached its defined point when the utility is being executed. More information can be found on the API Scheduler wiki page .

If you send me a copy of the configuration file you're using (with the API Key removed), and the schedule that you want to make the API calls, then I'll have a look at whats configured and will point you in the right direction.

Thanks,

Steve

Share this post


Link to post
Share on other sites

Hi @Izu,

Thanks for sending your config to Support. I've had a look, and it's configured to log a new Service Request at 9 am every day:

image.png

The executable should be left running, and if it's running at 9 am then the new Service Request should be logged as expected. If you want to test this at a time that isn't 9 am, just change the CronSchedule parameter as required for testing, run the executable, then kill the executable before resetting the CronSchedule and re-running it.

Let me know how you get on with this.

Steve

Share this post


Link to post
Share on other sites

Hi Steve,

Thanks for the update.

I have applied the steps mentioned above. Please, could you advice on how I can check/confirm that the scheduler has generated the service requests.

 

Rgds,

Izu 

Share this post


Link to post
Share on other sites

Hi Steve,

I am unable to see a service request generated by the API Scheduler. I checked via a view and inputted the catalogue name  as a condition.

Please, could you have a look and let us know your feedback.

Rgds,

Izu  

Share this post


Link to post
Share on other sites

Hi @Izu,

Have you checked the scheduler tool log? Does that mention that the API call was successful, or failed?

Thanks,

Steve

Share this post


Link to post
Share on other sites

I am awaiting feedback on this issue.

Rgds,

Izu

Share this post


Link to post
Share on other sites

Hi @Izu,

Are you allowing the scheduler to continue running in the background after it's been executed? As it does need to be running at the time when the Cron schedule is due.

If so, and the API calls are still not being made, could you email me a copy of your current configuration file & the latest log file from the tool, and I'll see if there's anything we've missed.

Thanks,

Steve

Share this post


Link to post
Share on other sites

Hi Steve,

I sent the config and log files yesterday via the Hornbill Support email address.

 

Rgds,

Izu

Share this post


Link to post
Share on other sites

Hi @Izu,

The issue is with the CronSchedule expression defined in your configuration:

"CronSchedule":"0 0 9 * * 1-7",

You have 1-7 defined as the days of the week to make the API call at - this is incorrect and is causing the scheduler to fail. It should be 0-6 to define every day of the week (with 0 being Sunday and 6 being Saturday) - or you could replace this with a *. Please see the following extract from the Cron package documentation for more information:

Field name   | Mandatory? | Allowed values  | Allowed special characters
----------   | ---------- | --------------  | --------------------------
Seconds      | Yes        | 0-59            | * / , -
Minutes      | Yes        | 0-59            | * / , -
Hours        | Yes        | 0-23            | * / , -
Day of month | Yes        | 1-31            | * / , - ?
Month        | Yes        | 1-12 or JAN-DEC | * / , -
Day of week  | Yes        | 0-6 or SUN-SAT  | * / , - ?

I'll also make a change to the API Scheduler tool to catch and throw errors for these type of configuration errors, I'll post back here once done.

Kind regards,

Steve

Share this post


Link to post
Share on other sites

Hi Steve,

I amended the cron schedule expression yesterday as suggested and I have had a look at the log file and the output has not changed. The fact is the API scheduler has always been running as a background process since last month but the issue is I cannot confirm that the request/task is being generated.

 

Rgds,

Izu

 

Share this post


Link to post
Share on other sites

Hi @Izu,

Once you'd fixed the cron expression, did you restart the executable? The config is only loaded when the executable first starts, so the executable will need to be killed and restarted to take the changes. Once a schedule is reached as defined in your expression, you will see a message to the console, and in the log, to state if the API call was successful or otherwise.

Thanks,

Steve

Share this post


Link to post
Share on other sites

Hi Steve,

Thanks for the feedback.

Yes, I got the feedback that the API call was successful but I am unable to see the generated request/task in Service Manager. Please, could you let me know how to check\confirm that the request/task has been created.

 

Rgds,

Izu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×