Access certificates periodically

Tentatively closes #1965
This commit is contained in:
Damien Elmes 2022-08-19 09:54:54 +10:00
parent 7517af4942
commit 19deb7ad25
2 changed files with 12 additions and 0 deletions

View file

@ -1370,6 +1370,7 @@ title="{}" {}>{}</button>""".format(
True,
parent=self,
)
self.progress.timer(12 * 60 * 1000, self.refresh_certs, False, parent=self)
def onRefreshTimer(self) -> None:
if self.state == "deckBrowser":
@ -1385,6 +1386,15 @@ title="{}" {}>{}</button>""".format(
if elap > minutes * 60:
self.maybe_auto_sync_media()
def refresh_certs(self) -> None:
# The requests library copies the certs into a temporary folder on startup,
# and chokes when the file is later missing due to temp file cleaners.
# Work around the issue by accessing them once every 12 hours.
import certifi
with open(certifi.where(), "rb") as f:
f.read()
# Backups
##########################################################################

View file

@ -63,6 +63,8 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-stringcase]
ignore_missing_imports = True
[mypy-certifi]
ignore_missing_imports = True
[mypy-aqt.forms.*]
disallow_untyped_defs = false