How do I build a Python app that can run once a day for up to 2 hours?
MartinCarlsson2 (0)

Hey

I need some Python code to run once a day for about one or two hours.

The use case is that I'm connecting to an API and moving the result to blob storage (or S3).

It should take between one or two hours to run.

The approach I'm considering is, writing an API with Flask and scheduling with UptimeRobot.

from flask import Flask
import time

app = Flask(
  __name__,
)

@app.route('/')
def index():
  time.sleep(3600)
  return "Hey world"

if __name__ == '__main__':
  app.run(
	host='0.0.0.0',
	debug=True,
	port=8080
  )

However, it looks like UptimeRobot will timeout after 1 minute.

How do I build a Python app that can run once a day for up to 2 hours?

You are viewing a single comment. View All
MartinCarlsson2 (0)

@Coder100 are there any easy way to automatically deploy code on heroku from replit?