Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request implements sqlite pragma tuning, based on #1247 but using the current config structure (since the other method has trouble reading environment variables for nested config values).
When sqlite is used, then the following pragmas will be used by default:
The PR also disables
cache=shared
when not running using an in-memory database. It's kept for in-memory for testing purposes.I'm testing the PR on goblin.technology currently. It seems mostly ok, but i am getting some locked errors every couple minutes:
For more info on the above errors, see https://www.sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode
I believe they're being caused by messages being delivered to more than one account at a time, and running multiple concurrent processes to update the same entry. We will probably need to add some kind of locking here to fix this before merging this PR.... @NyaaaWhatsUpDoc did you also run into this problem when testing, or did it not show on a single-user instance?
closes #1335
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
go fmt ./...
andgolangci-lint run
.