Closed amyrprv closed 3 years ago
I utilize the Service and make an API endpoint so that the front end can trigger the process defined in my Service class. I haven't tried to stop the process when it is running. But you probably can try to pass a cancellation token to the process.
The service I referred to is like the one below.
In the CronJob class, you call the service to do work. You can do the same thing in your controller, and you don't need to initiate a scope in the controller. Then admins can click a button in a web page to run the job on demand.
How I can have control over jobs and manually start/stop themes?