forked from readthedocs/readthedocs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apps.py
31 lines (25 loc) · 943 Bytes
/
apps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import structlog
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
log = structlog.get_logger(__name__)
class Config(AppConfig):
name = 'readthedocs.builds'
label = 'builds'
verbose_name = _("Builds")
def ready(self):
from readthedocs.builds.tasks import ArchiveBuilds
from readthedocs.worker import app
app.tasks.register(ArchiveBuilds)
try:
from readthedocsext.monitoring.metrics.tasks import (
Metrics1mTask,
Metrics5mTask,
Metrics10mTask,
Metrics30mTask,
)
app.tasks.register(Metrics1mTask)
app.tasks.register(Metrics5mTask)
app.tasks.register(Metrics10mTask)
app.tasks.register(Metrics30mTask)
except (ModuleNotFoundError, ImportError):
log.warning('Metrics tasks could not be imported.')