murakumo 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require 'optopus'
2
2
 
3
3
  require 'misc/murakumo_const'
4
4
 
5
- Version = '0.1.0'
5
+ Version = Murakumo::VERSION
6
6
 
7
7
  def mrkmctl_parse_args
8
8
  optopus do
@@ -5,7 +5,7 @@ require 'socket'
5
5
 
6
6
  require 'misc/murakumo_const'
7
7
 
8
- Version = '0.1.0'
8
+ Version = Murakumo::VERSION
9
9
 
10
10
  def murakumo_parse_args
11
11
  optopus do
@@ -1,4 +1,6 @@
1
1
  module Murakumo
2
+ VERSION = '0.1.2'
3
+
2
4
  # Priority
3
5
  MASTER = 1
4
6
  SECONDARY = 0
@@ -49,10 +49,14 @@ module Murakumo
49
49
  })
50
50
 
51
51
  # ノードの更新をフック
52
- @gossip.context.callback_handler = lambda do |act, addr, ts, dt|
52
+ @gossip.context.callback_handler = lambda do |act, addr, ts, dt, old_dt|
53
53
  case act
54
- when :add, :comeback, :update
54
+ when :add, :comeback
55
+ # 追加・復帰の時は無条件に更新
55
56
  update(addr, dt)
57
+ when :update
58
+ # 更新の時はデータが更新されたときのみ更新
59
+ update(addr, dt) if dt != old_dt
56
60
  when :delete
57
61
  delete(addr)
58
62
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: murakumo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - winebarrel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-17 00:00:00 Z
18
+ date: 2011-11-19 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rubydns
@@ -41,12 +41,12 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- hash: 17
44
+ hash: 23
45
45
  segments:
46
46
  - 0
47
47
  - 1
48
- - 5
49
- version: 0.1.5
48
+ - 6
49
+ version: 0.1.6
50
50
  type: :runtime
51
51
  version_requirements: *id002
52
52
  - !ruby/object:Gem::Dependency