Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model: only pass "check_same_thread" arg for sqlite database #1662

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Aug 22, 2023

Fix #1661

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw the original

connect_args={"check_same_thread": False},
)
# Needed for the admin dash on sqlite.
connect_args = {"check_same_thread": False} if url.startswith("sqlite") else {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw the original line was:

connect_args={"check_same_thread": False} if conf.admin_dash else {}

But we don't have the admin_dash in config anymore. Should we still check that arg? I'm not sure what this param does actually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in sqlite, you get an exception if different threads use the same connection; and admin_dash runs on a different thread, so this param ignores that check.

@masenf masenf added this to the v0.2.6 milestone Aug 22, 2023
@picklelo picklelo merged commit 196bdc5 into main Aug 22, 2023
@masenf masenf deleted the masenf/db-connect-args branch August 29, 2023 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants