mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
npm-load-remove: checkPad.js example (#4711)
* npm-load-remove: checkPad.js example * npm-load-remove: checkPad.js example * npm-load-remove: checkPad.js example * npm-load-remove: checkPad.js example * npm-load-remove: checkPad.js example * npm-load-remove: checkPad.js example * npm-load-remove: checkPadDeltas * npm-load-remove: extractPadData * npm-load-remove: importSqlFile * npm-load-remove: rebuildPad * npm-load-remove: repairPad * npm-load-remove: checkAllPads * npm-load-remove: migrateDirtyDBtoRealDB * npm-load-remove: migrateDirtyDBtoRealDB path * npm-load-remove: migrateDirtyDBtoRealDB dbclose fix * npm-load-remove: migrateDirtyDBtoRealDB remove commented out line * npm-load-remove: migrateDirtyDBtoRealDB reintroduce util
This commit is contained in:
parent
5a865dfc7e
commit
efde0b787a
8 changed files with 2 additions and 42 deletions
|
@ -7,14 +7,9 @@
|
||||||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
|
if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
// initialize the database
|
// initialize the database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('ep_etherpad-lite/node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('ep_etherpad-lite/node/db/DB');
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID');
|
if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID');
|
||||||
|
|
||||||
// get the padID
|
// get the padID
|
||||||
|
@ -17,8 +14,6 @@ const padId = process.argv[2];
|
||||||
let checkRevisionCount = 0;
|
let checkRevisionCount = 0;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('ep_etherpad-lite/node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('ep_etherpad-lite/node/db/DB');
|
||||||
|
|
|
@ -14,12 +14,8 @@ const padId = process.argv[2];
|
||||||
|
|
||||||
const expect = require('../tests/frontend/lib/expect');
|
const expect = require('../tests/frontend/lib/expect');
|
||||||
const diff = require('ep_etherpad-lite/node_modules/diff');
|
const diff = require('ep_etherpad-lite/node_modules/diff');
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('ep_etherpad-lite/node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('ep_etherpad-lite/node/db/DB');
|
||||||
|
|
|
@ -15,12 +15,7 @@ if (process.argv.length !== 3) throw new Error('Use: node extractPadData.js $PAD
|
||||||
// get the padID
|
// get the padID
|
||||||
const padId = process.argv[2];
|
const padId = process.argv[2];
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('ep_etherpad-lite/node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('ep_etherpad-lite/node/db/DB');
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|
||||||
const log = (str) => {
|
const log = (str) => {
|
||||||
|
@ -47,8 +44,6 @@ const unescape = (val) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
|
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||||
|
|
|
@ -4,14 +4,7 @@
|
||||||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
process.chdir(`${npm.root}/..`);
|
|
||||||
|
|
||||||
// This script requires that you have modified your settings.json file
|
// This script requires that you have modified your settings.json file
|
||||||
// to work with a real database. Please make a backup of your dirty.db
|
// to work with a real database. Please make a backup of your dirty.db
|
||||||
// file before using this script, just to be safe.
|
// file before using this script, just to be safe.
|
||||||
|
@ -20,6 +13,7 @@ const util = require('util');
|
||||||
// `node --max-old-space-size=4096 bin/migrateDirtyDBtoRealDB.js`
|
// `node --max-old-space-size=4096 bin/migrateDirtyDBtoRealDB.js`
|
||||||
|
|
||||||
|
|
||||||
|
const util = require('util');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||||
const dirtyDb = require('ep_etherpad-lite/node_modules/dirty');
|
const dirtyDb = require('ep_etherpad-lite/node_modules/dirty');
|
||||||
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
|
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
|
||||||
|
@ -36,7 +30,7 @@ const util = require('util');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
console.log('Waiting for dirtyDB to parse its file.');
|
console.log('Waiting for dirtyDB to parse its file.');
|
||||||
const dirty = dirtyDb('var/dirty.db');
|
const dirty = dirtyDb(`${__dirname}/../var/dirty.db`);
|
||||||
const length = await new Promise((resolve) => { dirty.once('load', resolve); });
|
const length = await new Promise((resolve) => { dirty.once('load', resolve); });
|
||||||
|
|
||||||
console.log(`Found ${length} records, processing now.`);
|
console.log(`Found ${length} records, processing now.`);
|
||||||
|
|
|
@ -13,16 +13,11 @@ if (process.argv.length !== 4 && process.argv.length !== 5) {
|
||||||
throw new Error('Use: node bin/repairPad.js $PADID $REV [$NEWPADID]');
|
throw new Error('Use: node bin/repairPad.js $PADID $REV [$NEWPADID]');
|
||||||
}
|
}
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
const padId = process.argv[2];
|
const padId = process.argv[2];
|
||||||
const newRevHead = process.argv[3];
|
const newRevHead = process.argv[3];
|
||||||
const newPadId = process.argv[4] || `${padId}-rebuilt`;
|
const newPadId = process.argv[4] || `${padId}-rebuilt`;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('ep_etherpad-lite/node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,7 @@ const padId = process.argv[2];
|
||||||
|
|
||||||
let valueCount = 0;
|
let valueCount = 0;
|
||||||
|
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm');
|
|
||||||
const util = require('util');
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await util.promisify(npm.load)({});
|
|
||||||
|
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('ep_etherpad-lite/node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('ep_etherpad-lite/node/db/DB');
|
||||||
|
|
Loading…
Reference in a new issue