Permalink
Browse files

Merge "enable larger snapshots for mongodb"

  • Loading branch information...
2 parents 6490c9e + 8e68df6 commit 189b4ae9d13a62c92d5016a8ee7bfc03dbbddb3f @Seanzhao Seanzhao committed with Gerrit Code Review Nov 27, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 mongodb/lib/mongodb_service/job/util.rb
@@ -28,8 +28,9 @@ def dump_database(service_id, file, opts={})
tar_path = @config['tar_path'] ? @config['tar_path'] : 'tar'
cmd_timeout = @config['timeout'].to_f
-
- tmp_dir = Dir.mktmpdir
+ tmp_dir = @config['tmp_dir'] ? @config['tmp_dir']: '/tmp'
+ FileUtils.mkdir_p(tmp_dir)
+ tmp_dir = Dir.mktmpdir(nil, tmp_dir)
service = Node::ProvisionedService.get(service_id)
version = service.version || @config["default_version"]
mongodump_path = @config['mongodump_path'] ? @config['mongodump_path'][version.to_s] : 'mongodump'
@@ -78,10 +79,9 @@ def restore_database(service_id, file)
mongorestore_path = @config['mongorestore_path'] ? @config['mongorestore_path'][version.to_s] : 'mongorestore'
tar_path = @config['tar_path'] ? @config['tar_path'] : 'tar'
cmd_timeout = @config['timeout'].to_f
-
-
- tmp_dir = Dir.mktmpdir
-
+ tmp_dir = @config['tmp_dir'] ? @config['tmp_dir']: '/tmp'
+ FileUtils.mkdir_p(tmp_dir)
+ tmp_dir = Dir.mktmpdir(nil, tmp_dir)
service = Node::ProvisionedService.get(service_id)
db = Mongo::Connection.new('127.0.0.1', service.port).db(service.db)
db.authenticate(service.admin, service.adminpass)

0 comments on commit 189b4ae

Please sign in to comment.