Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run it during downtime?

Currently, when it eventually matches the time_defined then runs the code in the if statement.

Would like to put this. What would be the proper approach to doing so?

Also, any suggestions on optimization are welcomed as well.

Thank you in advance!

like image 514
Jo Ko Avatar asked Dec 04 '25 04:12

Jo Ko


1 Answers

The best and easiest way to do this is to convert your python function into an AWS Lambda python function (easy), and then use AWS Cloudwatch events to trigger the function at whatever time interval you want (also easy).

What is Amazon CloudWatch Events?

Amazon CloudWatch Events delivers a near real-time stream of system events that describe changes in Amazon Web Services (AWS) resources to Amazon EC2 instances, AWS Lambda functions, Amazon Kinesis streams, Amazon ECS tasks, Step Functions state machines, Amazon SNS topics, Amazon SQS queues, or built-in targets. Using simple rules that you can quickly set up, you can match events and route them to one or more target functions or streams.

http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html

like image 143
E.J. Brennan Avatar answered Dec 05 '25 16:12

E.J. Brennan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!