1234567891011121314151617181920212223242526272829 |
- 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.randomTask.findMany({
- where: {
- finish: 1,
- },
- take: 2000,
- })
- await forEachAsync(accountsRaw, concurrency, async (account, index) => {
- console.log(`${index}/${accountsRaw.length}: processing ${account.address}`)
- console.log(account.id)
- try {
- // await faucetAccount(account.address)
- const notDone = []
- } catch (e) {
- console.log(e)
- // await DBClient.instance.account.update({
- // where: { id: account.id },
- // data: { status: Status.MayQueued, message: e.message },
- // })
- }
- })
- }
- startCheck(20)
|