https://prefect.io logo
#prefect-community
Title
# prefect-community
k

Koby Kilimnik

05/17/2022, 3:32 PM
i have 4 simple flows i ran periodically every hour and for some reason it looks like i am running more than 20k tasks, are clock registrations being multiplied in some way?
k

Kevin Kho

05/17/2022, 4:02 PM
I’m not getting what you mean by clock registrations here. Could you elaborate? Do you mean you added multiple clocks to the schedule?
k

Koby Kilimnik

05/17/2022, 4:03 PM
no i have a dlow in which i simply create an interval clock
i was wondering, when i bump the version and re-register
k

Kevin Kho

05/17/2022, 4:03 PM
Can you show me in code?
k

Koby Kilimnik

05/17/2022, 4:03 PM
what happens to the old version clock
sure
Copy code
def _create_clock(env_name: str, tables: list[str], optimized_format: str) -> Clock:
    return IntervalClock(
        interval=OPTIMIZED_TABLE_CREATION_INTERVAL,
        parameter_defaults={
            "env_name": env_name,
            "tables": tables,
            "optimized_format": optimized_format,
        },
    )
this is passed to:
Copy code
clocks = _create_clocks(...)
Schedule(clocks=clocks)
k

Kevin Kho

05/17/2022, 4:05 PM
The clock/schedule in general will not be tied to the task run count. It would be tied to the Flow run count. I think you could see in the dashboard if you have more flow runs than you are expecting. To answer though, the old version of the Flow is archived when you re-register and won’t be used
k

Koby Kilimnik

05/17/2022, 4:06 PM
yeah but i would assume that if i have a 1 per 3 hours run for a flow
with about 10 tasks in each flow
that would mean i would have in general 4*10 task runs a day
not 20k , so i was wondering if i have a bug and that the old clocks are still set somewhere
since its intervals it would be
4*10* (deploy count)
(using prefect cloud)
looking at the run logs it looks like i dont have that many , which is weird
k

Kevin Kho

05/17/2022, 4:10 PM
You can check the schedule tab of the Flow to verify, but no previous Flow versions can’t be run by Prefect Cloud. You would get an error if it were attempted
k

Koby Kilimnik

05/17/2022, 4:10 PM
thanks
3 Views