Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/master/buildbot/status/web/changes.py b/master/buildbot/status/web/changes.py
index 9670237..65d2421 100644
--- a/master/buildbot/status/web/changes.py
+++ b/master/buildbot/status/web/changes.py
@@ -17,6 +17,8 @@
from zope.interface import implements
from twisted.python import components
from twisted.web.error import NoResource
+from twisted.web import resource
+from twisted.web.server import NOT_DONE_YET
from buildbot.changes.changes import Change
from buildbot.status.web.base import HtmlResource, IBox, Box
@@ -32,6 +34,19 @@ class ChangeResource(HtmlResource):
data = template.render(cxt)
return data
+class DeferredLeafResource(resource.Resource):
+ pending = []
+ isLeaf = True
+ def __init__(self, d):
+ self.d = d
+ def render(self, request):
+ def cb(res):
+ request.write(res.render(request))
+ request.finish()
+ return res
+ self.d.addCallbacks(cb)
+ return NOT_DONE_YET
+
# /changes/NN
class ChangesResource(HtmlResource):
@@ -53,7 +68,7 @@ class ChangesResource(HtmlResource):
def eb(f):
return NoResource("No change number %d" % num)
d.addCallbacks(cb, eb)
- return d
+ return DeferredLeafResource(d)
class ChangeBox(components.Adapter):
implements(IBox)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment