16 lines
391 B
TypeScript
16 lines
391 B
TypeScript
import { BlockChain } from 'chain/BlockChain'
|
|
import { singleton } from 'decorators/singleton'
|
|
import * as schedule from 'node-schedule'
|
|
|
|
@singleton
|
|
export default class BlocknumSchedule {
|
|
parseAllRecord() {
|
|
new BlockChain().updateCurrenBlockNum()
|
|
}
|
|
scheduleAll() {
|
|
const job = schedule.scheduleJob('*/5 * * * * *', async () => {
|
|
await this.parseAllRecord()
|
|
})
|
|
}
|
|
}
|