diff options
author | Zuul <zuul@review.opendev.org> | 2022-02-24 21:10:37 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-02-24 21:10:37 +0000 |
commit | 99b0eade8c42fab800d344555682c9e14c8b20aa (patch) | |
tree | 4b9e93d147b7c7c102ccd9799f3d69504fd7dd61 /zuul/web/__init__.py | |
parent | 2c6a1bfdb70cb99fd9921d92cb191d12443b6dfe (diff) | |
parent | c2d959fdba0f8032f83535e55256c21a1e3a2367 (diff) | |
download | zuul-99b0eade8c42fab800d344555682c9e14c8b20aa.tar.gz |
Merge "Cache serialized tenant status"
Diffstat (limited to 'zuul/web/__init__.py')
-rwxr-xr-x | zuul/web/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py index 06c41c5fc..d12f8835e 100755 --- a/zuul/web/__init__.py +++ b/zuul/web/__init__.py @@ -1004,6 +1004,7 @@ class ZuulWebAPI(object): last_modified_header = last_modified.strftime('%a, %d %b %Y %X GMT') resp.headers["Last-modified"] = last_modified_header resp.headers['Access-Control-Allow-Origin'] = '*' + resp.headers['Content-Type'] = 'application/json; charset=utf-8' return payload def formatStatus(self, tenant): @@ -1043,7 +1044,7 @@ class ZuulWebAPI(object): status['management_events'] = len( management_event_queues[pipeline.name]) pipelines.append(status) - return data + return data, json.dumps(data).encode('utf-8') def _getTenantOrRaise(self, tenant_name): tenant = self.zuulweb.abide.tenants.get(tenant_name) @@ -1062,15 +1063,14 @@ class ZuulWebAPI(object): @cherrypy.expose @cherrypy.tools.save_params() - @cherrypy.tools.json_out(content_type='application/json; charset=utf-8') def status(self, tenant): - return self._getStatus(tenant) + return self._getStatus(tenant)[1] @cherrypy.expose @cherrypy.tools.save_params() @cherrypy.tools.json_out(content_type='application/json; charset=utf-8') def status_change(self, tenant, change): - payload = self._getStatus(tenant) + payload = self._getStatus(tenant)[0] result_filter = ChangeFilter(change) return result_filter.filterPayload(payload) |