h

    Hedgar

    6 months ago
    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
    ?
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Hedgar

    6 months ago
    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?
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Hedgar

    6 months ago
    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 * * *
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Hedgar

    6 months ago
    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
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Hedgar

    6 months ago
    excellent @Kevin Kho 👍