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

excessive database queries #141

Open
buhman opened this issue Jan 17, 2016 · 0 comments
Open

excessive database queries #141

buhman opened this issue Jan 17, 2016 · 0 comments
Labels

Comments

@buhman
Copy link
Member

buhman commented Jan 17, 2016

There's some patterns like this:

cur = model.get_digest(stream)
if cur.count():
    return 'already exists'
else:
    model.insert(stream)

Digest is indexed, so catching DuplicateKeyError is sufficient. No idea who wrote this shit.

@buhman buhman added the bug label Jan 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant