Allow EXTRA_OPTS with MONGO_CUSTOM_URI

This commit is contained in:
Dave Conroy
2022-10-07 08:03:24 -07:00
parent 4a8f85ddf5
commit 8b41f5efcf

View File

@@ -170,7 +170,7 @@ backup_mongo() {
fi
if [ -n "${MONGO_CUSTOM_URI}" ] ; then
mongo_generated_uri="${MONGO_CUSTOM_URI}"
mongo_generated_uri="${MONGO_CUSTOM_URI} ${EXTRA_OPTS}"
else
if [ "${MONGO_HOST_TYPE,,}" = "atlas" ] ; then
MONGO_URI_PREFIX=${MONGO_URI_PREFIX:-"mongodb+srv://"}
@@ -182,7 +182,7 @@ backup_mongo() {
fi
pre_dbbackup "${DB_NAME}"
print_notice "Dumping MongoDB database: '${DB_NAME}' ${compression_string}"
silent mongodump --archive=${TEMP_LOCATION}/${target} ${mongo_compression} --uri=${mongo_generated_uri} ${EXTRA_OPTS}
silent mongodump --archive=${TEMP_LOCATION}/${target} ${mongo_compression} --uri="${mongo_generated_uri}"
exit_code=$?
check_exit_code $target
generate_checksum