I have written a lambda using Python which is dependent upon external APIs which can occasionally go down. This is triggered once a day using EventBridge to gather data from yesterday, and updates a file in S3 at the same time every day.
I was wondering how I would be able to re-run the Lambda, which includes a check as to whether the external API is functioning at the start, every 1-2 hours for the rest of the day until it successfully works? It would need to stop at 11pm so as to not go into the next calendar day.
Specifically I am using the Google Search Console API which should have updated every 4 hours but hasn't in this case for 30.
Appreciate the help!