Hi! I am registering a flow like this: ``` ...
# prefect-community
m
Hi! I am registering a flow like this:
Copy code
schedule = IntervalSchedule(
            start_date=datetime.utcnow() + timedelta(seconds=1),
            interval=timedelta(hours=1),
        )

        flow.schedule = schedule
        flow.register()
and it works, but after 10 intervals, it simply stops. Where am I wrong?
c
Are you running on Windows?
m
No, on Linux (in a Docker environment)
c
We had a user experience a similar issue recently and it turned out to be an issue with Docker on Windows, not sure if a similar thing applies in your case: https://github.com/PrefectHQ/prefect/issues/2697
m
Interesting, seems to be the exact same issue. I’ll have a look if I can derive something from that
c
👍 👍
m
I did not have the timezones synced and fixed that, but it does not seem to resolve the issue. Also the containers and the host are in sync
DeActivating and Reactivation the Schedule in the UI again creates 10 flow runs
The log of the server does not show anything special
j
@Matthias I believe the scheduler only schedules 10 runs out at a time. Once one runs then another will be added to the pile. If you change your interval schedule’s
interval
to something smaller (like every minute) do you see more runs being scheduled once some get ran?
m
Hi @josh, I just did that and it does not add new runs
Copy code
from datetime import timedelta, datetime
from prefect import task, Flow
from prefect.schedules import IntervalSchedule

@task
def getone():
    return 1

schedule = IntervalSchedule(
    start_date=datetime.utcnow() + timedelta(seconds=1),
    interval=timedelta(minutes=1),
)

with Flow("testflow", schedule=schedule) as flow:
    getone()

flow.register()
c
This is definitely some issue with timezones running in your containers, not an issue with your Prefect code which looks fine (e.g., if you registered this flow with Cloud it would behave as you expect)
m
Oh crap. I managed to remove the scheduler from the docker-compose file and of course it does not schedule anything
j
😄 Does it seem to be scheduling after readding it?
m
Works now just fine 🤦‍♂️
👍 1