mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-30 09:50:11 -06:00
@@ -66,6 +66,7 @@ DEFAULTS = {
|
||||
|
||||
# Security:
|
||||
"MINIMIZE_INFORMATION_EXPOSURE": False,
|
||||
"PHONEHOME": True,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -143,6 +143,8 @@ BUGSINK = {
|
||||
"KEEP_ENVELOPES": int(os.getenv("KEEP_ENVELOPES", 0)), # keep this many in the database; 0 means "don't keep"
|
||||
"MINIMIZE_INFORMATION_EXPOSURE":
|
||||
os.getenv("MINIMIZE_INFORMATION_EXPOSURE", "false").lower() in ("true", "1", "yes"),
|
||||
|
||||
"PHONEHOME": os.getenv("PHONEHOME", "true").lower() in ("true", "1", "yes"),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ def _phone_home():
|
||||
# features in snappea, [b] we introduce a certain symmetry of measurement between the 2 setups, i.e. the choice of
|
||||
# lazyness does not influence counting and [c] do I really want to get pings for sites where nobody visits home()?
|
||||
|
||||
# NOTE: each time this function is called, it will schedule a new task, even when the task would quickly return
|
||||
# (nothing due, or configured to never send). We _could_ improve that, but doesn't seem performance-critical enough.
|
||||
send_if_due.delay() # _phone_home() wrapper serves as a place for the comment above
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ INTERVAL = 60 * 60 # phone-home once an hour
|
||||
def send_if_due():
|
||||
# considered: not sending if DEBUG=True. But why? Expectation is: I'm the sole user of that setting. Better send
|
||||
# also, to keep symmetry, and indirectly check whether my own phone-home still works.
|
||||
if not get_settings().PHONEHOME:
|
||||
return
|
||||
|
||||
# Note on attempted_at / sent_at distinction: attempted_at is when we first tried to send the message, and sent_at
|
||||
# is when we actually sent it. This allows us to try only once an hour, as well as track whether sending succeeded.
|
||||
|
||||
Reference in New Issue
Block a user