// import { DBClient } from '../singletons' // import { Status } from '../models/Status' // import { forEachAsync } from '../utils' // import { InitiaClient } from '../InitiaClient' // // async function startCheck(concurrency) { // const accountsRaw = await DBClient.instance.account.findMany({ // where: { // status: Status.Task2Done, // }, // take: 2500, // }) // await forEachAsync(accountsRaw, concurrency, async (account, index) => { // console.log(`${index}/${accountsRaw.length}: processing ${account.address}`) // try { // // await faucetAccount(account.address) // // const client = new InitiaClient(account.mnemonic, true) // // const bool = await client.swapScript() // console.log(bool) // if (bool == `done`) { // await DBClient.instance.account.update({ // where: { id: account.id }, // data: { status: Status.Task3Done }, // }) // } // } catch (e) { // console.log(e) // // await DBClient.instance.account.update({ // // where: { id: account.id }, // // data: { status: Status.MayQueued, message: e.message }, // // }) // } // }) // } // // startCheck(20)