apiotics 0.1.111 → 0.1.112

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
  SHA1:
3
- metadata.gz: f7941cda6cf8b706f704f109bbe86effc49cc315
4
- data.tar.gz: 5a28aa75a2e5838f10dedf2a8ea16ac9e13c0e06
3
+ metadata.gz: 5007367f501df0bb05c0612079946658c8e15f56
4
+ data.tar.gz: 3a552859fb24d1bd58ebf2d56e73339fc1baae30
5
5
  SHA512:
6
- metadata.gz: 9f92464a6eb7c601da9abac696c06684d249ad650e22fc0efbd6d519f6aa809bd521fe9d39186e2cc2db57269fc3baf089ed93dff118b32c2a10a4687c31c6e0
7
- data.tar.gz: 85c75f434f2bb134717a2e3b2719ee18119065b44b62c94bbea2849a392e3512ecf3a3dfc6f8c873ad73ac62e75badacec65e06e2237590ccdd740f768ab1dc1
6
+ metadata.gz: 8efb4673cde40d770ccb53fe210466f8ae785815fff21dbc4c3d54b724e4b695d35f65e1fed0716c3fd66f53b265a5609f82123dd359df930fe00fcb8ccf2385
7
+ data.tar.gz: 84ea913b7060227856366383f42ba82b2f7c2b969a4a5a2c8827bb004e89a3c827a6e73f1d972e7c0d79b13ff7a32cf4b4cc7f7fd52e87be619dffebc86c1506
@@ -17,8 +17,10 @@ module Apiotics
17
17
  connection.puts( msg )
18
18
  connection.close
19
19
  else
20
- redis = ::Redis.new
21
- redis.publish Apiotics.configuration.public_key, msg
20
+ if $redis == nil
21
+ $redis = ::Redis.new
22
+ end
23
+ $redis.publish Apiotics.configuration.public_key, msg
22
24
  end
23
25
  end
24
26
 
@@ -11,6 +11,11 @@ module Apiotics
11
11
  class Server
12
12
  def initialize
13
13
  begin
14
+ if Apiotics.configuration.redis_comms_connection == true
15
+ if $redis == nil
16
+ $redis = ::Redis.new
17
+ end
18
+ end
14
19
  Thread.abort_on_exception = true
15
20
  hive_public_key = ApioticsSetting.find_by(key: "hive_public_key")
16
21
  if hive_public_key == nil || hive_public_key.value != Apiotics.configuration.public_key
@@ -148,8 +153,7 @@ module Apiotics
148
153
  raise e
149
154
  end
150
155
  else
151
- redis = ::Redis.new
152
- redis.subscribe(Apiotics.configuration.public_key) do |on|
156
+ $redis.subscribe(Apiotics.configuration.public_key) do |on|
153
157
  on.message do |channel, msg|
154
158
  if @error_msg != nil
155
159
  string = '{"error":"' + error_msg + '"}'
@@ -1,3 +1,3 @@
1
1
  module Apiotics
2
- VERSION = '0.1.111'
2
+ VERSION = '0.1.112'
3
3
  end
@@ -1,13 +1,30 @@
1
1
  Apiotics.configure do |config|
2
+ # The public and private keys are available on the Apiotics portal. Navigate to your Hive's page and they will be towards the top
2
3
  config.public_key = nil #set this to an Environment variable
3
4
  config.private_key = nil #set this to an Environment variable
5
+
6
+ # If your local comms server is accepting TCP connections, the local port is the port that it will accept connections on
4
7
  config.local_port = 8001
8
+
9
+ # If you are deploying to a hosting service like Heroku, which does not easily permit local TCP connections, turn the redis comms connection
10
+ # on, and configure a Redis server to permit connections between your application and your local comms server
11
+ config.redis_comms_connection = false
12
+
13
+ # The remote port at Apiotics to initially connect to. There should be very few reasons to change this.
5
14
  config.server_port = 8000
15
+
16
+ # The Apiotics portal. Again, very few reasons to change this.
6
17
  config.portal = "https://www.apiotics.com/"
18
+
19
+ # Secure communications parameters. The defaults should be appropriate for almost all use cases.
7
20
  config.tls = true
8
21
  config.verify_peer = true
9
22
  config.handshake = true
23
+
24
+ # Local logging. By default these are set to try and have a happy medium between the data you have in your local application's database
25
+ # and performance. Turning local logging on can have a significant negative impact on performance. Turning reduced metadata on can have
26
+ # a small positive impact on performance. These configuration variables should be set *before* running apiotics generators.
10
27
  config.local_logging = false
11
28
  config.reduced_metadata = false
12
- config.redis_comms_connection = false
29
+
13
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiotics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.111
4
+ version: 0.1.112
5
5
  platform: ruby
6
6
  authors:
7
7
  - MicroArx Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails