mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Add missing file
This commit is contained in:
33
snappea/settings.py
Normal file
33
snappea/settings.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
DEFAULTS = {
|
||||
"TASK_ALWAYS_EAGER": False,
|
||||
|
||||
"PID_FILE": "/tmp/snappea.pid",
|
||||
"WAKEUP_CALLS_DIR": "/tmp/snappea.wakeup",
|
||||
|
||||
"NUM_WORKERS": 4,
|
||||
"GRACEFUL_TIMEOUT": 10,
|
||||
|
||||
"TASK_QS_LIMIT": 100,
|
||||
|
||||
}
|
||||
|
||||
|
||||
class AttrLikeDict(dict):
|
||||
def __getattr__(self, item):
|
||||
return self[item]
|
||||
|
||||
|
||||
_settings = None
|
||||
|
||||
|
||||
def get_settings():
|
||||
global _settings
|
||||
if _settings is None:
|
||||
_settings = AttrLikeDict()
|
||||
_settings.update(DEFAULTS)
|
||||
_settings.update(getattr(settings, "SNAPPEA", {}))
|
||||
|
||||
return _settings
|
||||
Reference in New Issue
Block a user