-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQLite cache: Use
requests_cache.CachedSession
for better concurrency
Users on Apple M2 Max reported DB lock errors: [grafana_wtf.core] INFO: Fetching dashboards in parallel with 5 concurrent requests [requests_cache.backends.sqlite] WARNING: Database is locked in thread 6272069632; retrying (1/3) Also segmentation faults, and leaks: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
- Loading branch information
Showing
5 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from sys import modules | ||
|
||
import niquests | ||
import urllib3 | ||
|
||
# Amalgamate the module namespace to make all modules aiming | ||
# to use `requests`, in fact use `niquests` instead. | ||
modules["requests"] = niquests | ||
modules["requests.adapters"] = niquests.adapters | ||
modules["requests.sessions"] = niquests.sessions | ||
modules["requests.exceptions"] = niquests.exceptions | ||
modules["requests.packages.urllib3"] = urllib3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.