Skip to content

Commit

Permalink
add profiler to project init (#2255)
Browse files Browse the repository at this point in the history
  • Loading branch information
bz888 authored Feb 19, 2024
1 parent 32764b8 commit e487881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/node-core/src/indexer/store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ export class StoreService {
}
}

// eslint-disable-next-line complexity
async syncSchema(schema: string): Promise<void> {
const tx = await this.sequelize.transaction();
if (this.historical) {
Expand Down
6 changes: 6 additions & 0 deletions packages/node/src/indexer/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
StoreService,
NodeConfig,
IProjectUpgradeService,
profiler,
} from '@subql/node-core';
import { SubstrateDatasource } from '@subql/types';
import { Sequelize } from '@subql/x-sequelize';
Expand Down Expand Up @@ -63,6 +64,11 @@ export class ProjectService extends BaseProjectService<
);
}

@profiler()
async init(startHeight?: number): Promise<void> {
return super.init(startHeight);
}

protected async getBlockTimestamp(height: number): Promise<Date> {
const block = await getBlockByHeight(this.apiService.api, height);
return getTimestamp(block);
Expand Down

0 comments on commit e487881

Please sign in to comment.