Skip to content

Commit

Permalink
fix(service manager): recover from missing hash key
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Apr 19, 2021
1 parent a8f9c3d commit 95761d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: redis_service_manager
version: 1.1.3
version: 1.1.5
crystal: ~> 1.0

dependencies:
Expand Down
7 changes: 7 additions & 0 deletions src/redis_service_manager.cr
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ class RedisServiceManager
end
end

# ensure this node is in the node list
if !leader && @hash[node_key]? != @uri
@hash[node_key] = @uri
new_list << node_key
new_list.sort!.uniq!
end

new_list - delete
end
end
Expand Down

0 comments on commit 95761d6

Please sign in to comment.