peatio 2.4.2 → 2.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7501f3bc4884f0d1a87ca148a6583150151d8b94349a7a4b8cd18890cf4a9d08
4
- data.tar.gz: 80e9ab1529ddf6e1f9fbd06eac0f7c263b2c50b5c455cd68d268e63d5f654736
3
+ metadata.gz: a855d75a60ccfbec0f38f79159c52fe38d2364accb962ca8f5435fc5a25e5403
4
+ data.tar.gz: 9d651e0f008ad7d21f722557016c690e1e949d5cffc12f25e6c4328124a601de
5
5
  SHA512:
6
- metadata.gz: f8e778a89f9f4eea227edefd70f2e6304da2f8723b46c2ac5fe388a285dc7c2d9d7a65c0448e6db2dfca4bd4844c098148222627ce0f9ddf26b00986dea81115
7
- data.tar.gz: e22e11488eac433bf315d537b9ed24ac5dc06bb42189b487f25967b9a1da7e60bd63149de22d37faef26c97504006a51dce06132e995cd8f6cfe5afdd55ad894
6
+ metadata.gz: 8b20714e79a658d829a0c2e5d4c53ff8f94c04de098c549854c1cd29059092592caf22e69d05533252914187dd442694acbb26100e0979f897c19706d8657e26
7
+ data.tar.gz: bc70c96a616952d8e12dbbd697fd403ba4e611e0b5aa7eb6b07ce003f286c4fb234ed536c6f994034c4c90ec03627a29c2c517f1c7a57be4aeee3f8e72c7a6d3
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Peatio::Ranger
4
2
  class Connection
5
3
  attr_reader :socket, :user, :authorized, :streams, :logger, :id
@@ -23,7 +21,11 @@ module Peatio::Ranger
23
21
  end
24
22
 
25
23
  def send_raw(payload)
26
- logger.debug { "sending to user #{user.inspect} payload: #{payload}" }
24
+ if user
25
+ logger.debug { "sending to user #{user.inspect} payload: #{payload}" }
26
+ else
27
+ logger.debug { "sending to anonymous payload: #{payload}" }
28
+ end
27
29
  @socket.send(payload)
28
30
  end
29
31
 
@@ -77,6 +79,11 @@ module Peatio::Ranger
77
79
  def handle(msg)
78
80
  return if msg.to_s.empty?
79
81
 
82
+ if msg =~ /^ping/
83
+ send_raw("pong")
84
+ return
85
+ end
86
+
80
87
  data = JSON.parse(msg)
81
88
  case data["event"]
82
89
  when "subscribe"
@@ -42,7 +42,7 @@ module Peatio::Ranger
42
42
  end
43
43
 
44
44
  socket.onerror do |e|
45
- logger.info { "WebSocket Error: #{e.message}" }
45
+ logger.error { "WebSocket Error: #{e.message}\n" + e.backtrace.join("\n") }
46
46
  end
47
47
  end
48
48
  end
@@ -1,3 +1,3 @@
1
1
  module Peatio
2
- VERSION = "2.4.2"
2
+ VERSION = "2.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peatio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis B.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-11 00:00:00.000000000 Z
12
+ date: 2020-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel