fix: mongorestore argv
This commit is contained in:
@@ -85,9 +85,9 @@ export class BackupService {
|
||||
try {
|
||||
cd(tempDirPath)
|
||||
await $`unzip backup.zip`
|
||||
await $`mongorestore -h ${process.env.DB_URL || '127.0.0.1'} -d ${
|
||||
MONGO_DB.collectionName
|
||||
} ./mx-space --drop >/dev/null 2>&1`
|
||||
await $`mongorestore -h ${MONGO_DB.host || '127.0.0.1'} --port ${
|
||||
MONGO_DB.port || 27017
|
||||
} -d ${MONGO_DB.collectionName} ./mx-space --drop >/dev/null 2>&1`
|
||||
|
||||
this.logger.debug('恢复成功')
|
||||
await this.adminGateway.broadcast(
|
||||
@@ -118,9 +118,9 @@ export class BackupService {
|
||||
}
|
||||
|
||||
cd(dirPath)
|
||||
await $`mongorestore -h ${process.env.DB_URL || '127.0.0.1'} -d ${
|
||||
MONGO_DB.collectionName
|
||||
} ./mx-space --drop >/dev/null 2>&1`
|
||||
await $`mongorestore -h ${MONGO_DB.host || '127.0.0.1'} --port ${
|
||||
MONGO_DB.port || 27017
|
||||
} -d ${MONGO_DB.collectionName} ./mx-space --drop >/dev/null 2>&1`
|
||||
} catch (e) {
|
||||
this.logger.error(e)
|
||||
throw e
|
||||
|
||||
Reference in New Issue
Block a user