civo-logger 0.2.4 → 0.2.5

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: 532250a46bcb5ef9626496c1f3c15d64793aec3f
4
- data.tar.gz: c54194a9ca526310cb4d088cb71b1e497962579a
3
+ metadata.gz: e6491505ef84412b4fb86abdd78e068d78c095e6
4
+ data.tar.gz: 8d6d07286fa47ee87bf6d6eaafca9c6f9bdbddbb
5
5
  SHA512:
6
- metadata.gz: f5a5c8333bd237a7ababd1fdb7263f2cbc131c017949b83c559e0e0d6a33273af6f3c5748871493d7a438f1375fb39dbc41c1545507ab3d832b6fcd6f9e241dd
7
- data.tar.gz: 9ac9a447cc768a1a31b4db13f8e498d2d5315facf60cf20327ae28411f1d9bab3dc1b46c2926a6941c8da88f2e3893beb3f1668ecba8caafd8ce263ac1d355b5
6
+ metadata.gz: 79b2c9b432c5c5b36ac51577338e9cf1b4567087bd00e5e63ef7bf1da92b3fe66c4f56916eaaff61970515eca0148a760c46571f43111a8cd53054783ce0abe2
7
+ data.tar.gz: 0754bf8ca015c5aa3413fb8cce50e08d6b99d6ea75c1450fba0104f18d72f71724a6857ec42a5d98405046cc3d14303a2e1230b66bbda295acccf9b723f73bcf
@@ -111,6 +111,12 @@ module Civo
111
111
 
112
112
  def end_worker
113
113
  puts @lines.join("\n") if Rails.env.production?
114
+
115
+ if @redis.nil?
116
+ puts @log
117
+ return
118
+ end
119
+
114
120
  @redis.set("#{app_name}:log:#{@key}", @lines.join("\n"), ex: self.class.expires_in)
115
121
  rescue Redis::TimeoutError, Redis::CannotConnectError => e
116
122
  puts "ERROR! Redis error #{e.message}"
@@ -188,6 +194,11 @@ module Civo
188
194
  @output = body.to_s
189
195
  end
190
196
 
197
+ if @redis.nil?
198
+ puts @log
199
+ return
200
+ end
201
+
191
202
  @redis.set("#{app_name}:log:#{@key}", @log[0, 65535], ex: self.class.expires_in)
192
203
  @redis.set("#{app_name}:log-output:#{@key}", @output, ex: self.class.expires_in)
193
204
 
@@ -1,5 +1,5 @@
1
1
  module Civo
2
2
  module Logger
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civo-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-21 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler