Question, I have a simple flow that runs a single ...
# prefect-community
a
Question, I have a simple flow that runs a single Postgres function through the SqlAlchemy module. I have orion running on a remote node, and I am running an agent locally and connecting to a test queue to try things out... I am getting multiple min delays between the flow starting and the task starting though
1
Copy code
21:56:02.157 | INFO    | prefect.agent - Submitting flow run 'd85644d0-f274-46e0-a79b-70ebb8f61300'
21:56:02.517 | INFO    | prefect.infrastructure.process - Opening process 'holistic-boar'...
21:56:02.523 | INFO    | prefect.agent - Completed submission of flow run 'd85644d0-f274-46e0-a79b-70ebb8f61300'
21:59:11.038 | INFO    | Flow run 'holistic-boar' - Created task run 'sqlalchemy_execute-3e2bf708-0' for task 'sqlalchemy_execute'
21:59:11.040 | INFO    | Flow run 'holistic-boar' - Executing 'sqlalchemy_execute-3e2bf708-0' immediately...
21:59:13.977 | INFO    | Task run 'sqlalchemy_execute-3e2bf708-0' - Finished in state Completed()
21:59:14.062 | INFO    | Flow run 'holistic-boar' - Finished in state Completed('All states completed.')
Searched through slack as much as I could without luck. Not quite sure what to try.
m
Hey Adam, could you please give a little more background on the set up of the flow you are running that is causing the delay? thanks
a
Absolutely... both of these flows were delayed in starting (the stars one is stolen right off docs):
Copy code
import httpx
from prefect import flow, task
from prefect_sqlalchemy import DatabaseCredentials, AsyncDriver
from prefect_sqlalchemy.database import sqlalchemy_execute


@task(retries=3)
def get_stars(repo):
    url = f"<https://api.github.com/repos/{repo}>"
    count = httpx.get(url).json()["stargazers_count"]
    print(f"{repo} has {count} stars!")


@flow
def github_stars(repos):
    for repo in repos:
        get_stars(repo)


@flow
def calculate_claim():
    sqlalchemy_credentials = DatabaseCredentials(
        driver=AsyncDriver.POSTGRESQL_ASYNCPG,
        database="xxx",
        host="xxx",
        port=5432,
        username="client_demo",
        password="xxx"

    )
    sqlalchemy_execute(
        "SELECT calculate_claim();",
        sqlalchemy_credentials,
    )
Anything else you need that would be helpful here?
Guess i'll open an issue for this one too
m
Adam, thanks for opening an issue for this one. I think thats the best route forward for now. Appreciate it!
1