0

I was wondering if it was possible to have a web service running on Flask to execute a function at a certain time every day.

I'm making a Slack bot with Flask and Python, and I want the bot to send out a reminder every day at 6:00 to a channel.

Is it possible to keep track of the current time continuously, and only perform an action once the current time equals a set time?

0

1 Answer 1

1

You could, but that is not a good way of doing it. Your operating system almost certainly has this functionality built-in; on unix-like systems for example you would use cron.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried using an APScheduler cron job, but the problem with that was that it had to be run as a separate job, or else the cron jobs would be blocking the Flask tasks from running. I'd rather keep everything in one project.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.