mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Removed Bluebird from DB backup file
refs https://github.com/TryGhost/Ghost/issues/14882 - we're slowly moving away from Bluebird and don't need it here to achieve what we need
This commit is contained in:
parent
42768937fd
commit
b1ff826a61
@ -3,7 +3,6 @@
|
|||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const Promise = require('bluebird');
|
|
||||||
const config = require('../../../shared/config');
|
const config = require('../../../shared/config');
|
||||||
const logging = require('@tryghost/logging');
|
const logging = require('@tryghost/logging');
|
||||||
const urlUtils = require('../../../shared/url-utils');
|
const urlUtils = require('../../../shared/url-utils');
|
||||||
@ -40,23 +39,24 @@ const readBackup = async (filename) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Backup
|
* Does an export, and stores this in a local file
|
||||||
* does an export, and stores this in a local file
|
*
|
||||||
* @returns {Promise<*>}
|
* @param {Object} options
|
||||||
|
* @returns {Promise<String>}
|
||||||
*/
|
*/
|
||||||
const backup = async function backup(options = {}) {
|
const backup = async function backup(options = {}) {
|
||||||
logging.info('Creating database backup');
|
logging.info('Creating database backup');
|
||||||
|
|
||||||
const props = {
|
const filename = await exporter.fileName(options);
|
||||||
data: exporter.doExport(options),
|
const data = await exporter.doExport(options);
|
||||||
filename: exporter.fileName(options)
|
|
||||||
};
|
|
||||||
|
|
||||||
const exportResult = await Promise.props(props);
|
const filePath = await writeExportFile({
|
||||||
const filename = await writeExportFile(exportResult);
|
data,
|
||||||
|
filename
|
||||||
|
});
|
||||||
|
|
||||||
logging.info('Database backup written to: ' + filename);
|
logging.info(`Database backup written to ${filePath}`);
|
||||||
return filename;
|
return filePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
Loading…
Reference in New Issue
Block a user