Skip to content

Commit 7a55a0a

Browse files
authored
[release] bump coordinator v2.0.4
Coordinator enhancement
2 parents 44d1e03 + 52d717a commit 7a55a0a

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

apps/indexer-coordinator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@subql/indexer-coordinator",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "",
55
"author": "SubQuery",
66
"license": "Apache-2.0",

apps/indexer-coordinator/src/core/contract.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ export class ContractService {
4040

4141
async getOverrides(): Promise<Overrides> {
4242
const gasPrice = await this.provider.getGasPrice();
43-
const gasLimit = BigNumber.from(1000000);
44-
return { gasPrice, gasLimit };
43+
const overrides = {
44+
maxFeePerGas: gasPrice,
45+
maxPriorityFeePerGas: gasPrice,
46+
};
47+
return overrides;
4548
}
4649

4750
async getBlockTime() {

apps/indexer-coordinator/src/project/project.service.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { Injectable } from '@nestjs/common';
5+
import { Cron, CronExpression } from '@nestjs/schedule';
56
import { InjectRepository } from '@nestjs/typeorm';
67
import { bytes32ToCid, GraphqlQueryClient, IPFSClient } from '@subql/network-clients';
78
import { NETWORK_CONFIGS } from '@subql/network-config';
@@ -71,6 +72,20 @@ export class ProjectService {
7172
void this.restoreProjects();
7273
}
7374

75+
@Cron(CronExpression.EVERY_DAY_AT_4AM)
76+
async autoUpdateProjectInfo() {
77+
const projects = await this.projectRepo.find();
78+
for (const project of projects) {
79+
try {
80+
const projectInfo = await this.getProjectInfoFromNetwork(project.id);
81+
project.details = projectInfo;
82+
await this.projectRepo.save(project);
83+
} catch (e) {
84+
getLogger('project').warn(`Failed to update project info: ${project.id}`);
85+
}
86+
}
87+
}
88+
7489
getProject(id: string): Promise<Project> {
7590
return this.projectRepo.findOneBy({ id });
7691
}

0 commit comments

Comments
 (0)