@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.

Fix some functions being used before they are defined

Summary: Minor JSHint fixes.

Test Plan: `arc lint`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

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

+31 -31
+31 -31
support/aphlict/server/aphlict_server.js
··· 12 12 JX.require('lib/AphlictListenerList', __dirname); 13 13 JX.require('lib/AphlictLog', __dirname); 14 14 15 - var debug = new JX.AphlictLog() 16 - .addConsole(console); 17 - 18 - var clients = new JX.AphlictListenerList(); 19 - 20 - var config = parse_command_line_arguments(process.argv); 21 - 22 - if (config.logfile) { 23 - debug.addLogfile(config.logfile); 24 - } 25 - 26 15 function parse_command_line_arguments(argv) { 27 16 var config = { 28 17 port: 22280, ··· 48 37 config.admin = parseInt(config.admin, 10); 49 38 50 39 return config; 40 + } 41 + 42 + var debug = new JX.AphlictLog() 43 + .addConsole(console); 44 + 45 + var clients = new JX.AphlictListenerList(); 46 + 47 + var config = parse_command_line_arguments(process.argv); 48 + 49 + if (config.logfile) { 50 + debug.addLogfile(config.logfile); 51 51 } 52 52 53 53 if (process.getuid() !== 0) { ··· 161 161 var messages_in = 0; 162 162 var start_time = new Date().getTime(); 163 163 164 + function transmit(msg) { 165 + var listeners = clients.getListeners().filter(function(client) { 166 + return client.isSubscribedToAny(msg.subscribers); 167 + }); 168 + 169 + for (var i = 0; i < listeners.length; i++) { 170 + var listener = listeners[i]; 171 + 172 + try { 173 + listener.writeMessage(msg); 174 + 175 + ++messages_out; 176 + debug.log('<%s> Wrote Message', listener.getDescription()); 177 + } catch (error) { 178 + clients.removeListener(listener); 179 + debug.log('<%s> Write Error: %s', listener.getDescription(), error); 180 + } 181 + } 182 + } 183 + 164 184 http.createServer(function(request, response) { 165 185 // Publishing a notification. 166 186 if (request.url == '/') { ··· 232 252 response.end(); 233 253 } 234 254 }).listen(config.admin, config.host); 235 - 236 - function transmit(msg) { 237 - var listeners = clients.getListeners().filter(function(client) { 238 - return client.isSubscribedToAny(msg.subscribers); 239 - }); 240 - 241 - for (var i = 0; i < listeners.length; i++) { 242 - var listener = listeners[i]; 243 - 244 - try { 245 - listener.writeMessage(msg); 246 - 247 - ++messages_out; 248 - debug.log('<%s> Wrote Message', listener.getDescription()); 249 - } catch (error) { 250 - clients.removeListener(listener); 251 - debug.log('<%s> Write Error: %s', listener.getDescription(), error); 252 - } 253 - } 254 - } 255 255 256 256 // If we're configured to drop permissions, get rid of them now that we've 257 257 // bound to the ports we need and opened logfiles.