Skip to content

Refactor db-accessing utility methods of TaskQueue #3

@s-fleck

Description

@s-fleck

Prepared statements
The series of functions beginning with n_pending should really only be one function. This is the perfect use case for prepared statements. Make that status number a parameter.

Don't conflate purpose
TaskQueue.print really does two things - a fetch and a print. You should probably separate these.

sqlite autocommit
From the brief Google I did, sqlite operates in autocommit mode by default. I don't think any of the commits you've done are necessary.

Implicit cursors
It shouldn't be necessary to explicitly get those cursors. You can iterate on the return value of fetchall.

https://codereview.stackexchange.com/questions/226369/a-persistent-file-system-operations-queue-using-sqlite-and-json-text-fields/226398#226398

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions