bmc-daemon-lib 0.10.3 → 0.11.0

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: 42f7c7f0eb5280febec27e6bad758667e31c778f
4
- data.tar.gz: 9bbef69a7da892c222c2526f46dcadf77ccacf26
3
+ metadata.gz: 5e310d3a2ec000411286ea62a49815223b2f9e43
4
+ data.tar.gz: 9c9d16f29b9d121ccc20717012c2b7fee401b032
5
5
  SHA512:
6
- metadata.gz: 366b3c4835e0335c40ffd9a00d53948eb2cad81e724659b12a9b44f3babbe0e3eb1c577038f5eebb53e0951e0c3ae8045043ef449908f21fdd445c3f43701a69
7
- data.tar.gz: 506f27e3f85b579f349d5e12338df7a2b3b6b24b078055eb11e2680cbf27cb5a301a673da8d7033b194118fc232fef4ca06df64d1413d5be75f95f5303d0c78d
6
+ metadata.gz: f47929c8cdcff98598bc491327eb54ccce4e0d84c48d8c8f25ab6db7901100beac4b150c051059212b79372558dc20b8036036fc5f43af3501e17fca9736e5f3
7
+ data.tar.gz: f625227ac059b003c4680bbf3d83268931aa756c76577e42e0fc0bb9e952bd90b6df5b43269a0d88626f03f1b2d2f4f99b1905440d0b7016f3245e7975ad9bcd
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  # Project version
4
- spec.version = "0.10.3"
4
+ spec.version = "0.11.0"
5
5
 
6
6
  # Project description
7
7
  spec.name = "bmc-daemon-lib"
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = "opensource@bmconseil.com"
10
10
  spec.description = "Shared utilities to build a daemon: logger, configuration, helpers"
11
11
  spec.summary = spec.description
12
- spec.homepage = "http://github.com/bmedici/bmc-daemon-lib"
12
+ spec.homepage = "http://github.com/bmedici/#{spec.name}"
13
13
  spec.licenses = ["MIT"]
14
14
  spec.date = Time.now.strftime("%Y-%m-%d")
15
15
 
@@ -56,7 +56,7 @@ module BmcDaemonLib
56
56
  end
57
57
 
58
58
  # Add details from hash
59
- elsif details.is_a? Hash
59
+ elsif details.is_a?(Hash) || details.is_a?(Hashie::Mash)
60
60
  details.each do |key, value|
61
61
  messages << sprintf(@format[:hash], key, value)
62
62
  end
@@ -10,6 +10,7 @@ module BmcDaemonLib
10
10
  STATUS_FINISHED = "finished"
11
11
  STATUS_CRASHED = "crashed"
12
12
  STATUS_TIMEOUT = "timeout"
13
+ STATUS_DOWN = "down"
13
14
 
14
15
  # Class options
15
16
  attr_reader :pool
@@ -57,16 +58,6 @@ module BmcDaemonLib
57
58
  sleep seconds
58
59
  end
59
60
 
60
- def working_on_job(job, working_on_it = false)
61
- if working_on_it
62
- job.wid = Thread.current.thread_variable_get :wid
63
- Thread.current.thread_variable_set :jid, job.id
64
- else
65
- job.wid = nil
66
- Thread.current.thread_variable_set :jid, nil
67
- end
68
- end
69
-
70
61
  def start_loop
71
62
  log_info "start_loop starting", @config
72
63
  loop do
@@ -81,7 +72,7 @@ module BmcDaemonLib
81
72
  worker_sleep @config[:timer]
82
73
 
83
74
  rescue StandardError => e
84
- log_error "WORKER EXCEPTION: #{e.inspect}"
75
+ log_error "WORKER EXCEPTION: #{e.inspect}", e.backtrace
85
76
  sleep 1
86
77
  end
87
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmc-daemon-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-12 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler