Last post Jan 06, 2021 02:19 AM by YihuiSun
Member
10 Points
80 Posts
Jan 05, 2021 02:23 PM|fmrock164|LINK
So I have a method in one of my controllers I need to call once a day at like 1am.
The question is what is the best method to do this. Create a schedule job to authenticate, then send a POST to the URL?
Is there a better way?
The application a private app, and a user with the correct permissions would need to be able to call the URL.
All-Star
53041 Points
23616 Posts
Jan 05, 2021 02:30 PM|mgebhard|LINK
A controller action is not the best approach. Usually, a SQL job or executable is scheduled to run which executes the logic.
Jan 05, 2021 03:21 PM|fmrock164|LINK
I wish I could use a SQL job, I need to push items through windows workflow process.
Jan 05, 2021 03:47 PM|mgebhard|LINK
fmrock164 I wish I could use a SQL job, I need to push items through windows workflow process.
Windows Workflow can invoke an executable.
Contributor
2730 Points
779 Posts
Jan 06, 2021 02:19 AM|YihuiSun|LINK
Hi fmrock164,
You can use Hangfire to perform background processing in .NET and .NET Core applications.
Best Regards,
YihuiSun
Member
10 Points
80 Posts
Need to call controller once a day
Jan 05, 2021 02:23 PM|fmrock164|LINK
So I have a method in one of my controllers I need to call once a day at like 1am.
The question is what is the best method to do this. Create a schedule job to authenticate, then send a POST to the URL?
Is there a better way?
The application a private app, and a user with the correct permissions would need to be able to call the URL.
All-Star
53041 Points
23616 Posts
Re: Need to call controller once a day
Jan 05, 2021 02:30 PM|mgebhard|LINK
A controller action is not the best approach. Usually, a SQL job or executable is scheduled to run which executes the logic.
Member
10 Points
80 Posts
Re: Need to call controller once a day
Jan 05, 2021 03:21 PM|fmrock164|LINK
I wish I could use a SQL job, I need to push items through windows workflow process.
All-Star
53041 Points
23616 Posts
Re: Need to call controller once a day
Jan 05, 2021 03:47 PM|mgebhard|LINK
Windows Workflow can invoke an executable.
Contributor
2730 Points
779 Posts
Re: Need to call controller once a day
Jan 06, 2021 02:19 AM|YihuiSun|LINK
Hi fmrock164,
You can use Hangfire to perform background processing in .NET and .NET Core applications.
Best Regards,
YihuiSun