Error protect database access; re-create corrupt queue DB. #33

Closed
df wants to merge 4 commits from df/webif:df-queuesafer-patch into master
Owner

A set of changes to queue.class to prevent database errors from propagating out of the queue class methods.

In queue dbhandle, wrap all database access in try/catch; also minimally verify the database and re-create the schema if that fails, as well as for a new database file. Incidentally Jim 0.81 implements try natively.

Add three new class methods with database access wrapped in try and encapsulating the call to queue dbhandle:

# return the text result of running query on the queue DB 
proc {queue dbquery} {query args} {...}

# run query on the queue DB and return success/failure 
proc {queue dbaction} {query args} {...}

# run each item of the query_list on the queue DB
# if txn_mode is a valid transaction mode, wrap the whole query_list in a transaction 
proc {queue dbqueryl} {query_list {txn_mode ""}} {...}

Elsewhere, use the above methods instead of direct database methods as appropriate.

A set of changes to `queue.class` to prevent database errors from propagating out of the `queue` class methods. In `queue dbhandle`, wrap all database access in `try`/`catch`; also minimally verify the database and re-create the schema if that fails, as well as for a new database file. Incidentally Jim 0.81 implements `try` natively. Add three new class methods with database access wrapped in `try` and encapsulating the call to `queue dbhandle`: ``` # return the text result of running query on the queue DB proc {queue dbquery} {query args} {...} # run query on the queue DB and return success/failure proc {queue dbaction} {query args} {...} # run each item of the query_list on the queue DB # if txn_mode is a valid transaction mode, wrap the whole query_list in a transaction proc {queue dbqueryl} {query_list {txn_mode ""}} {...} ``` Elsewhere, use the above methods instead of direct database methods as appropriate.
df added 1 commit 2021-02-09 15:34:11 +00:00
df added 1 commit 2021-02-09 15:51:14 +00:00
df added 1 commit 2021-02-09 17:19:24 +00:00
df added 1 commit 2021-02-22 16:10:46 +00:00
df changed title from WIP: Error protect database access; re-create corrupt queue DB. to Error protect database access; re-create corrupt queue DB. 2021-02-22 16:14:43 +00:00
Owner

Merged.

Merged.
af123 closed this pull request 2021-02-24 12:56:01 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hummypkg/webif#33
No description provided.