Fixed missing path and await.
This commit is contained in:
4
main.js
4
main.js
@@ -5,11 +5,11 @@ const { createDriver } = require('./modules/driverManager');
|
||||
const { createAccount } = require('./modules/microsoftHandler');
|
||||
|
||||
async function main() {
|
||||
const numAccounts = 3;
|
||||
const numAccounts = 1;
|
||||
await connect();
|
||||
const accountPromises = [];
|
||||
for (let i = 0; i < numAccounts; i++) {
|
||||
const promise = createAccount(createDriver());
|
||||
const promise = await createAccount(createDriver());
|
||||
accountPromises.push(promise);
|
||||
console.log(`Account ${i + 1} done!`);
|
||||
await new Promise((resolve) => setTimeout(resolve, 20000));
|
||||
|
||||
@@ -102,7 +102,7 @@ async function createAccount(driver) {
|
||||
|
||||
let accounts = [];
|
||||
if (fs.existsSync(path.join(__dirname, '../accounts/accounts.json'))) {
|
||||
const content = fs.readFileSync('accounts.json', 'utf8');
|
||||
const content = fs.readFileSync(path.join(__dirname, '../accounts/accounts.json'), 'utf8');
|
||||
accounts = JSON.parse(content);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user