I want to add a method to my minos.cqrs.Service to be executed every day at 9:00 AM. How can I do that?
Here is my current code:
from minos.cqrs import Service
class MyService(Service):
async def task(self) -> None:
print("Running periodic task...")
To add a periodic task to a
minos.cqrs.Serviceclass, you can create a standard handling method and decorate it with the@enroute.periodic.eventdecorator fromminos.networksand pass it a validcronexpression as argument (0 9 * * *in your case).Here is an example: