Check for new version

This commit is contained in:
Leigh Morresi
2021-03-01 15:09:37 +01:00
parent 5b2fda1a6e
commit b31bf34890
5 changed files with 43 additions and 15 deletions

View File

@@ -513,18 +513,28 @@ def changedetection_app(config=None, datastore_o=None):
# Check for new version and anonymous stats
def check_for_new_version():
import requests
app.config['NEW_VERSION_AVAILABLE'] = True
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
while not app.config.exit.is_set():
r = requests.post("https://changedetection.io/check-ver.php",
data={'version': datastore.data['version_tag'],
'app_guid': datastore.data['app_guid']},
try:
r = requests.post("https://changedetection.io/check-ver.php",
data={'version': datastore.data['version_tag'],
'app_guid': datastore.data['app_guid']},
verify=False)
verify=False)
except:
pass
app.config.exit.wait(10)
try:
if "new_version" in r.text:
app.config['NEW_VERSION_AVAILABLE'] = True
except:
pass
# Check daily
app.config.exit.wait(86400)
# Requests for checking on the site use a pool of thread Workers managed by a Queue.