@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor improvements for handling of `/status/` for Aphlict

Summary: We don't need to handle any request data for the `/status/` route, so we can simplify this code slightly.

Test Plan:
```lang=bash
> curl http://127.0.0.1:22281/status/
{"uptime":2543,"clients.active":0,"clients.total":0,"messages.in":0,"messages.out":0,"log":"/var/log/aphlict.log","version":6}
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11145

+12 -19
+12 -19
support/aphlict/server/aphlict_server.js
··· 226 226 response.end(); 227 227 } 228 228 } else if (request.url == '/status/') { 229 - request.on('data', function() { 230 - // We just ignore the request data, but newer versions of Node don't 231 - // get to 'end' if we don't process the data. See T2953. 232 - }); 229 + var status = { 230 + 'uptime': (new Date().getTime() - start_time), 231 + 'clients.active': clients.getActiveListenerCount(), 232 + 'clients.total': clients.getTotalListenerCount(), 233 + 'messages.in': messages_in, 234 + 'messages.out': messages_out, 235 + 'log': config.log, 236 + 'version': 6 237 + }; 233 238 234 - request.on('end', function() { 235 - var status = { 236 - 'uptime': (new Date().getTime() - start_time), 237 - 'clients.active': clients.getActiveListenerCount(), 238 - 'clients.total': clients.getTotalListenerCount(), 239 - 'messages.in': messages_in, 240 - 'messages.out': messages_out, 241 - 'log': config.log, 242 - 'version': 6 243 - }; 244 - 245 - response.writeHead(200, {'Content-Type': 'application/json'}); 246 - response.write(JSON.stringify(status)); 247 - response.end(); 248 - }); 239 + response.writeHead(200, {'Content-Type': 'application/json'}); 240 + response.write(JSON.stringify(status)); 241 + response.end(); 249 242 } else { 250 243 response.statusCode = 404; 251 244 response.write('404 Not Found\n');