Fixed linting errors/warnings and tests

The test failure was due to pollBorker waiting the full 5 seconds before
polling for the first time.

The lint errors were some trailing whitespace and unecessary fat arrows
This commit is contained in:
Cecylia Bocovich 2019-06-27 09:28:36 -04:00
parent 799a13d385
commit 788f2a595f
2 changed files with 6 additions and 4 deletions

View file

@ -55,7 +55,9 @@ class Snowflake
@makeProxyPair @relayAddr
log 'ProxyPair Slots: ' + @proxyPairs.length
log 'Snowflake IDs: ' + (@proxyPairs.map (p) -> p.id).join ' | '
@pollInterval = setInterval((=> @pollBroker()), config.defaultBrokerPollInterval)
@pollBroker()
@pollInterval = setInterval((=> @pollBroker()),
config.defaultBrokerPollInterval)
log @pollInterval
# Regularly poll Broker for clients to serve until this snowflake is
@ -72,9 +74,9 @@ class Snowflake
msg += '[retries: ' + @retries + ']' if @retries > 0
@ui.setStatus msg
recv = @broker.getClientOffer pair.id
recv.then (desc) =>
recv.then (desc) ->
@receiveOffer pair, desc
, (err) =>
, (err) ->
pair.active = false
@retries++