Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enable larger snapshots for mongodb

Change-Id: I5aa09a320e4e18bab976959faa6aeef0c77b19e3
  • Loading branch information...
commit 8e68df6e344fbffb7bc7721b1ae09a9a26b937b7 1 parent ca37e4d
@Seanzhao Seanzhao authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 mongodb/lib/mongodb_service/job/util.rb
View
12 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)
Please sign in to comment.
Something went wrong with that request. Please try again.