File tree 3 files changed +28
-9
lines changed
3 files changed +28
-9
lines changed Original file line number Diff line number Diff line change 103
103
CURRENT_LANGUAGE = 'en_US'
104
104
SUPPORTED_LANGUAGES = ['en_US' ]
105
105
106
+ # Sentry.io error reporting rate (0.0 TO 1.0)
107
+ # 0.0 = no error reporting to Sentry
108
+ # 0.5 = 1/2 of errors reported to Sentry
109
+ # 1.0 = all errors reporting to Sentry
110
+ # STABLE: If this version matches the current version (reported on openshot.org)
111
+ # UNSTABLE: If this version does not match the current version (reported on openshot.org)
112
+ # STABLE_VERSION: This is the current stable release reported by openshot.org
113
+ ERROR_REPORT_RATE_STABLE = 0.0
114
+ ERROR_REPORT_RATE_UNSTABLE = 0.0
115
+ ERROR_REPORT_STABLE_VERSION = None
116
+
106
117
try :
107
118
from language import openshot_lang
108
119
language_path = ":/locale/"
Original file line number Diff line number Diff line change 28
28
29
29
import platform
30
30
31
+ from classes .logger import log
31
32
from classes import info
32
33
33
34
try :
@@ -47,12 +48,16 @@ def init_tracing():
47
48
return
48
49
49
50
# Determine sample rate for exceptions
50
- traces_sample_rate = 0.1
51
- environment = "production"
52
- if "-dev" in info .VERSION :
53
- # Dev mode, trace all exceptions
54
- traces_sample_rate = 1.0
55
- environment = "development"
51
+ traces_sample_rate = 0.0
52
+ if info .VERSION == info .ERROR_REPORT_STABLE_VERSION :
53
+ traces_sample_rate = info .ERROR_REPORT_RATE_STABLE
54
+ environment = "production"
55
+ else :
56
+ traces_sample_rate = info .ERROR_REPORT_RATE_UNSTABLE
57
+ environment = "unstable"
58
+
59
+ if info .ERROR_REPORT_STABLE_VERSION :
60
+ log .info ("Sentry initialized with %s error reporting rate (%s)" % (traces_sample_rate , environment ))
56
61
57
62
# Initialize sentry exception tracing
58
63
sdk .init (
Original file line number Diff line number Diff line change 30
30
from classes .app import get_app
31
31
from classes import info
32
32
from classes .logger import log
33
- import json
33
+
34
34
35
35
def get_current_Version ():
36
36
"""Get the current version """
@@ -46,10 +46,13 @@ def get_version_from_http():
46
46
# Send metric HTTP data
47
47
try :
48
48
r = requests .get (url , headers = {"user-agent" : "openshot-qt-%s" % info .VERSION }, verify = False )
49
- log .info ("Found current version: %s" % r .text )
49
+ log .info ("Found current version: %s" % r .json () )
50
50
51
51
# Parse version
52
- openshot_version = r .json ()["openshot_version" ]
52
+ openshot_version = r .json ().get ("openshot_version" )
53
+ info .ERROR_REPORT_STABLE_VERSION = r .json ().get ("openshot_version" )
54
+ info .ERROR_REPORT_RATE_STABLE = r .json ().get ("error_rate_stable" )
55
+ info .ERROR_REPORT_RATE_UNSTABLE = r .json ().get ("error_rate_unstable" )
53
56
54
57
# Emit signal for the UI
55
58
get_app ().window .FoundVersionSignal .emit (openshot_version )
You can’t perform that action at this time.
0 commit comments