I have a website with code that I want to make run periodically (sending e-mails).
My web.xml is as follows:
<servlet-mapping>
<servlet-name>sendEmailsController</servlet-name>
<url-pattern>/cron/sendEmails</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>sendEmailsController</servlet-name>
<servlet-class>sendEmailsController</servlet-class>
</servlet>
I am trying to schedule the code to run through Google Cloud Scheduler, but when I'm editing the 'Service Account' field to insert my [email protected], I get a black pop-up saying: Updating job "myJob" failed: Unknown error
I've tried saving the job with the Service Account field left blank and it shows Success, but it doesn't run my code (does not send e-mails), neither prints the logs I left in the code. Also, I've tried adding the Cloud Scheduler Admin, Cloud Scheduler Job Runner and Cloud Scheduler Service Agent roles to the service account in case it was a problem with the permissions, but it didn't work either.
For Frequency, i'm using * * * * * (every minute), target is HTTP, HTTP Method is GET, and URL is https://myDomain/cron/sendEmails