grafana-toolbox / grafana-wtf

Grep through all Grafana entities in the spirit of git-wtf.
GNU Affero General Public License v3.0
138 stars 12 forks source link

SQLite cache: Use SQLite write-ahead logging for better concurrency #136

Closed amotl closed 2 months ago

amotl commented 2 months ago

Problem

@edgarasg reported there is still a problem with the SQLite-based cache and concurrent access.

Solution

@JWCook informed us about the wal=True argument to requests-cache' Session class/mixin, effectively enabling SQLite write-ahead logging, allowing read operations to not block writes.

[1] https://sqlite.org/wal.html

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.17%. Comparing base (756e395) to head (3fa8a80).

:exclamation: Current head 3fa8a80 differs from pull request most recent head 47348c7. Consider uploading reports for the commit 47348c7 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #136 +/- ## ======================================= Coverage 87.17% 87.17% ======================================= Files 9 9 Lines 1076 1076 ======================================= Hits 938 938 Misses 138 138 ``` | [Flag](https://app.codecov.io/gh/panodata/grafana-wtf/pull/136/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=panodata) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/panodata/grafana-wtf/pull/136/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=panodata) | `87.17% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=panodata#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.