mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
lint: Run eslint --fix
on bin/
and tests/
This commit is contained in:
parent
0625739cb8
commit
b8d07a42eb
78 changed files with 4319 additions and 4599 deletions
|
@ -1,6 +1,5 @@
|
|||
require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
|
||||
|
||||
process.chdir(npm.root+'/..')
|
||||
require('ep_etherpad-lite/node_modules/npm').load({}, (er, npm) => {
|
||||
process.chdir(`${npm.root}/..`);
|
||||
|
||||
// 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
|
||||
|
@ -10,40 +9,40 @@ require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
|
|||
// `node --max-old-space-size=4096 bin/migrateDirtyDBtoRealDB.js`
|
||||
|
||||
|
||||
var settings = require("ep_etherpad-lite/node/utils/Settings");
|
||||
var dirty = require("../src/node_modules/dirty");
|
||||
var ueberDB = require("../src/node_modules/ueberdb2");
|
||||
var log4js = require("../src/node_modules/log4js");
|
||||
var dbWrapperSettings = {
|
||||
"cache": "0", // The cache slows things down when you're mostly writing.
|
||||
"writeInterval": 0 // Write directly to the database, don't buffer
|
||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||
let dirty = require('../src/node_modules/dirty');
|
||||
const ueberDB = require('../src/node_modules/ueberdb2');
|
||||
const log4js = require('../src/node_modules/log4js');
|
||||
const dbWrapperSettings = {
|
||||
cache: '0', // The cache slows things down when you're mostly writing.
|
||||
writeInterval: 0, // Write directly to the database, don't buffer
|
||||
};
|
||||
var db = new ueberDB.database(settings.dbType, settings.dbSettings, dbWrapperSettings, log4js.getLogger("ueberDB"));
|
||||
var i = 0;
|
||||
var length = 0;
|
||||
const db = new ueberDB.database(settings.dbType, settings.dbSettings, dbWrapperSettings, log4js.getLogger('ueberDB'));
|
||||
let i = 0;
|
||||
let length = 0;
|
||||
|
||||
db.init(function() {
|
||||
console.log("Waiting for dirtyDB to parse its file.");
|
||||
dirty = dirty('var/dirty.db').on("load", function() {
|
||||
dirty.forEach(function(){
|
||||
db.init(() => {
|
||||
console.log('Waiting for dirtyDB to parse its file.');
|
||||
dirty = dirty('var/dirty.db').on('load', () => {
|
||||
dirty.forEach(() => {
|
||||
length++;
|
||||
});
|
||||
console.log(`Found ${length} records, processing now.`);
|
||||
|
||||
dirty.forEach(async function(key, value) {
|
||||
let error = await db.set(key, value);
|
||||
dirty.forEach(async (key, value) => {
|
||||
const error = await db.set(key, value);
|
||||
console.log(`Wrote record ${i}`);
|
||||
i++;
|
||||
|
||||
if (i === length) {
|
||||
console.log("finished, just clearing up for a bit...");
|
||||
setTimeout(function() {
|
||||
console.log('finished, just clearing up for a bit...');
|
||||
setTimeout(() => {
|
||||
process.exit(0);
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
console.log("Please wait for all records to flush to database, then kill this process.");
|
||||
console.log('Please wait for all records to flush to database, then kill this process.');
|
||||
});
|
||||
console.log("done?")
|
||||
console.log('done?');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue