File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @subql/indexer-coordinator" ,
3
- "version" : " 2.0.3 " ,
3
+ "version" : " 2.0.4 " ,
4
4
"description" : " " ,
5
5
"author" : " SubQuery" ,
6
6
"license" : " Apache-2.0" ,
Original file line number Diff line number Diff line change @@ -40,8 +40,11 @@ export class ContractService {
40
40
41
41
async getOverrides ( ) : Promise < Overrides > {
42
42
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 ;
45
48
}
46
49
47
50
async getBlockTime ( ) {
Original file line number Diff line number Diff line change 2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
4
import { Injectable } from '@nestjs/common' ;
5
+ import { Cron , CronExpression } from '@nestjs/schedule' ;
5
6
import { InjectRepository } from '@nestjs/typeorm' ;
6
7
import { bytes32ToCid , GraphqlQueryClient , IPFSClient } from '@subql/network-clients' ;
7
8
import { NETWORK_CONFIGS } from '@subql/network-config' ;
@@ -71,6 +72,20 @@ export class ProjectService {
71
72
void this . restoreProjects ( ) ;
72
73
}
73
74
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
+
74
89
getProject ( id : string ) : Promise < Project > {
75
90
return this . projectRepo . findOneBy ( { id } ) ;
76
91
}
You can’t perform that action at this time.
0 commit comments