Skip to content

Commit 826dfa6

Browse files
committed
Register ShutdownBuilder task
Register the task to shutdown the builders by themselves.
1 parent 702f9a3 commit 826dfa6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

readthedocs/builds/apps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
import logging
2+
13
from django.apps import AppConfig
24
from django.utils.translation import ugettext_lazy as _
35

6+
log = logging.getLogger(__name__)
7+
48

59
class Config(AppConfig):
610
name = 'readthedocs.builds'
@@ -11,3 +15,9 @@ def ready(self):
1115
from readthedocs.builds.tasks import ArchiveBuilds
1216
from readthedocs.worker import app
1317
app.tasks.register(ArchiveBuilds)
18+
19+
try:
20+
from readthedocsext.builds.tasks import ShutdownBuilder
21+
app.tasks.register(ShutdownBuilder)
22+
except (ModuleNotFoundError, ImportError):
23+
log.info('ShutdownBuilder task could not be imported.')

0 commit comments

Comments
 (0)