Navigation Menu

Skip to content

Commit

Permalink
Ensure state directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 24, 2014
1 parent 230de52 commit 5f5bc60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/droonga/command/serf_event_handler.rb
Expand Up @@ -72,6 +72,7 @@ def output_live_nodes
list_path = Path.live_nodes
nodes = live_nodes
file_contents = JSON.pretty_generate(nodes)
FileUtils.mkdir_p(list_path.parent.to_s)
# Don't output the file directly to prevent loading of incomplete file!
Tempfile.open(list_path.basename.to_s, list_path.parent.to_s, "w") do |output|
output.write(file_contents)
Expand Down

0 comments on commit 5f5bc60

Please sign in to comment.