@martinbean you mention jobs can be dispatched by an event listener.
I have a job to provision a Let's Encrypt certificate. I need this job triggered once when a 'project' is created (an event is fired) and again every 60 days to renew the certificate. I thought that a job would best fit this use case rather than an event listener, but it's getting the job triggered the first time that's giving me headache.
When the ProjectCreated event is fired, I would like to dispatch the job in response (ie as an event listener). I decided the best way to do this would be to create an event listener, named ProvisionNewCertificate, which responds to the ProjectCreated event and in turn triggers the ProvisionCertificate job.
Unfortunately, I keep getting the error that the ProjectCreated event is being passed as the first parameter to the handle() method of my ProvisionCertificate job, rather than the dependencies I have type-hinted.
Why it this - it seems my job methods are conflicting with my event listener. Alternatively, could you suggest a better way of doing this?
On a sidenote, to run the ProvisionCertificate job every 60 days, I was going to create a task scheduler (which runs every 3 hours, to satisfy Let's Encrypt rate limiting) and execute the ProvisonCertificate job (which can create / renew a cert) on any certificates expiring in 30 days or less. Again, is this what you'd recommend or is there a better way I haven't thought of. Personally, I'm not a huge fan of the idea of using cron to manage potentially hundreds of certificates, especially if I'm going to deploy to a serverless platform.