mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-13 02:47:31 +00:00
Add flag to load relations sequentially or concurrently (#225)
* Add flag to load relations sequentially or concurrently * Fix database init in graph-node test * Fix graph-node watcher query method and add changes to codegen
This commit is contained in:
@@ -9,7 +9,7 @@ import { StorageLayout } from '@cerc-io/solidity-mapper';
|
||||
|
||||
import { EventData } from '../../src/utils';
|
||||
import { Database } from '../../src/database';
|
||||
import { Indexer } from './indexer';
|
||||
import { Indexer, ServerConfig } from './indexer';
|
||||
|
||||
const NETWORK_URL = 'http://127.0.0.1:8081';
|
||||
const IPLD_ETH_SERVER_GQL_URL = 'http://127.0.0.1:8082/graphql';
|
||||
@@ -72,7 +72,8 @@ export const getDummyGraphData = (): any => {
|
||||
|
||||
export const getTestDatabase = (): Database => {
|
||||
const baseDatabase = new BaseDatabase({ type: 'postgres' });
|
||||
return new Database(baseDatabase);
|
||||
const serverConfig = new ServerConfig();
|
||||
return new Database(serverConfig, baseDatabase);
|
||||
};
|
||||
|
||||
export const getTestIndexer = (storageLayout?: Map<string, StorageLayout>): Indexer => {
|
||||
|
||||
@@ -203,7 +203,7 @@ export class Indexer implements IndexerInterface {
|
||||
}
|
||||
}
|
||||
|
||||
class ServerConfig implements ServerConfigInterface {
|
||||
export class ServerConfig implements ServerConfigInterface {
|
||||
host: string;
|
||||
port: number;
|
||||
mode: string;
|
||||
@@ -217,6 +217,7 @@ class ServerConfig implements ServerConfigInterface {
|
||||
maxEventsBlockRange: number;
|
||||
clearEntitiesCacheInterval: number;
|
||||
skipStateFieldsUpdate: boolean;
|
||||
loadRelationsSequential: boolean;
|
||||
|
||||
constructor () {
|
||||
this.host = '';
|
||||
@@ -232,5 +233,6 @@ class ServerConfig implements ServerConfigInterface {
|
||||
this.maxEventsBlockRange = 0;
|
||||
this.clearEntitiesCacheInterval = 0;
|
||||
this.skipStateFieldsUpdate = false;
|
||||
this.loadRelationsSequential = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user