j

    Jake

    4 months ago
    Hello! Is flow registration to prefect cloud asynchronous? I am trying to register multiple flows concurrently. Are there any examples of that?
    Kevin Kho

    Kevin Kho

    4 months ago
    The API only takes in one Flow so not really. Is it too slow for you? You are the one who has a CI/CD pipeline so you made a way to determine only the Flows with changes right?
    j

    Jake

    4 months ago
    yeah that’s me. It’s still too slow 😞. I’m also curious what exactly goes into building the hash generated from
    flow.serialized_hash()
    . I’ve noticed that sometimes the hash changes even though there were no changes in the code. Does it have anything to do with the pickle? I noticed that even when there are no code changes, the pickles contents changed.
    Kevin Kho

    Kevin Kho

    4 months ago
    That must mean you have something like
    datetime.datetime.now()
    in your schedule or something? Some timestamps that changes value from run to run
    j

    Jake

    4 months ago
    That could be it actually; let me double check
    This works by the way — it’s somewhat faster.
    # where register_flows is a function that calls flow.register()
    
    threads = []
    for project in projects:
               t = threading.Thread(
                   target=register_flows, args=(project)
               )
               threads.append(t)
               t.start()
    
    for thread in threads:
           thread.join()
    Kevin Kho

    Kevin Kho

    4 months ago
    Ah ok you could wrap the flow.register call in async too maybe
    j

    Jake

    4 months ago
    Yeah that works! But I’m not sure how to await them from a CLI
    Kevin Kho

    Kevin Kho

    4 months ago
    Ah I see. That’s true