mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Aphlict - fix getActiveListenerCount return value
Summary: Ref T7126. Dictionaries do not have a `length` property unlike arrays resulting in the `getActiveListenerCount()` function returning undefined results. Using the `length` property on the array of keys will work. Test Plan: Using `wscat` to generate multiple connections to the server, establish new ones and close others while keeping an eye on the displayed `clients.active` value. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T7126 Differential Revision: https://secure.phabricator.com/D11647
This commit is contained in:
parent
9df4cb37d4
commit
a424fec7bb
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ JX.install('AphlictListenerList', {
|
|||
},
|
||||
|
||||
getActiveListenerCount: function() {
|
||||
return this._listeners.length;
|
||||
return Object.keys(this._listeners).length;
|
||||
},
|
||||
|
||||
getTotalListenerCount: function() {
|
||||
|
|
Loading…
Reference in a new issue