🚨 back: fixing linter

This commit is contained in:
Eric Doughty-Papassideris
2024-10-28 16:23:44 +01:00
parent be2a02bd00
commit c8a54a1b66
@@ -37,7 +37,6 @@ const createTree = async (
context: any, context: any,
client: mongo.MongoClient, client: mongo.MongoClient,
) => { ) => {
const documentRepo = await gr.services.documents.documents.repository;
// Create an array to hold promises // Create an array to hold promises
const createFolderPromises = []; const createFolderPromises = [];
@@ -101,8 +100,7 @@ const command: yargs.CommandModule<unknown, CLIArgs> = {
const platform = await tdrive.run(services); const platform = await tdrive.run(services);
await gr.doInit(platform); await gr.doInit(platform);
let client: mongo.MongoClient; const client = (await gr.database.getConnector()).getClient();
client = (await gr.database.getConnector()).getClient();
// Manage the default company // Manage the default company
const companies = await gr.services.companies.getCompanies(); const companies = await gr.services.companies.getCompanies();
@@ -153,10 +151,8 @@ const command: yargs.CommandModule<unknown, CLIArgs> = {
} }
console.log("✅ Users created"); console.log("✅ Users created");
let updateBegin = Date.now(); const updateBegin = Date.now();
let createTreePromises = [];
for (const user of allUsers) { for (const user of allUsers) {
// console.log progress percentage
const context = { company, user }; const context = { company, user };
const parentDrive = `user_${user.id}`; const parentDrive = `user_${user.id}`;
const folderData = await getDefaultDriveItem( const folderData = await getDefaultDriveItem(
@@ -171,7 +167,6 @@ const command: yargs.CommandModule<unknown, CLIArgs> = {
await createTree(folderTreeDepth, folderData, parentDrive, context, client); await createTree(folderTreeDepth, folderData, parentDrive, context, client);
console.log(`✅ User ${user.id} folder tree created`); console.log(`✅ User ${user.id} folder tree created`);
} }
// await Promise.all(createTreePromises);
console.log("✅ Finished execution, took: ", (Date.now() - updateBegin) / 1000, "s"); console.log("✅ Finished execution, took: ", (Date.now() - updateBegin) / 1000, "s");
}, },
}; };