Hi The Prefect schedule does not seem to work. H...
# ask-community
k
Hi The Prefect schedule does not seem to work. Here is the code and command I ran. flows/tutorial.py
Copy code
from prefect import flow,get_run_logger

@flow
def my_favorite_function():

    logger = get_run_logger()
    <http://logger.info|logger.info>("aaaaaaaaaaaaaaaaaaaaaaaaaa")
    print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    return 42
Copy code
prefect deployment build flows/tutorial.py:my_favorite_function -n etl --cron "*/1 * * * *" -q etl --apply
prefect agent start -q 'etl
Is there a problem?
1
a
What's your prefect version? Your flow looks good 👍 I would check the UI and look at the runs in the scheduled state there (hard refresh your browser if you don't see them) and if this is still not working, could you open a GitHub issue in which you would describe how you set up your environment? It seems like you did everything correctly here so it might be some small environment misconfiguration
(you can link the GitHub issue here or tag me there)
k
thanks version is 2.5.0 I will try to reset the environment.
Does it not work well on a docker container?
j
It should be fine in a Docker container. Can you run it manually? Do other schedule types, such as interval, work ok?
👀 1
k
It worked by doing this. entrypoint.sh
Copy code
prefect orion database reset -y
prefect deployment build flows/tutorial.py:my_favorite_function -n etl --interval 60 -q etl --apply
nohup prefect orion start &
prefect agent start -q etl
It is now working.
j
Does cron work now, too?
k
Yes, it works now.
🙌 1