I think I have a challenge with my flow as it's ru...
# ask-community
h
I think I have a challenge with my flow as it's running twice instead of once(the scheduled time) If The last line of my flow code is
flow.register(projectname, flowname e.t.c
Would it be necessary to do again on the command line
prefect register...
before doing
prefect agent local start
?
k
Do you still have
flow.run()
in there somewhere? I think running twice is different from registering twice? and no you shouldn’t need to register twice
h
No I don't have
flow.run()
should I? I thought if I can start the local agent my flow would run when the schedule time hit?
k
Yes you shouldn’t have it for a registered flow. I was just asking because you said it’s running twice. What does your schedule look like in the UI?
Do you think it’s the old version firing also?
h
Runs every
07 18 * * *
but since I have a lambda that starts and shuts down my ec2 I wrote a bash script wherein I registered and starts the local agent at
03 18 *  * *
now instead of just running the schedule time it also runs @`03 18 * * *`
k
I think your bash script doesn’t need to register right? If it runs at
03 18 * * *
, I am also wondering if there was a late run lingering because the agent will just pick up all late runs when it starts
h
So I should just run
prefect agent local start
@
03 18 * * *
? I suspect registering again with cli is triggering a run and when the schedule time hit it equally run
k
Yes exactly and if it’s already registered with a schedule, then the scheduled run will be picked up by the agent. No further re-registration needed
h
excellent @Kevin Kho 👍