mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 16:54:08 +00:00
Refactor util code to be reused (#241)
* Ignore watch contract jobs in event processing complete handler * Update job-queue config and handle errors on job completion hook * Update graph decimal implementation * Return generic type from method to read watcher config * Export fill prefetch batch size default value
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
import debug from 'debug';
|
||||
|
||||
import { getConfig, resetJobs } from '@cerc-io/util';
|
||||
import { getConfig, resetJobs, Config } from '@cerc-io/util';
|
||||
|
||||
const log = debug('vulcanize:reset-job-queue');
|
||||
|
||||
@@ -15,7 +15,7 @@ export const desc = 'Reset job queue';
|
||||
export const builder = {};
|
||||
|
||||
export const handler = async (argv: any): Promise<void> => {
|
||||
const config = await getConfig(argv.configFile);
|
||||
const config: Config = await getConfig(argv.configFile);
|
||||
await resetJobs(config);
|
||||
|
||||
log('Job queue reset successfully');
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import debug from 'debug';
|
||||
import assert from 'assert';
|
||||
|
||||
import { getConfig, initClients, resetJobs, JobQueue } from '@cerc-io/util';
|
||||
import { getConfig, initClients, resetJobs, JobQueue, Config } from '@cerc-io/util';
|
||||
import { GraphWatcher, Database as GraphDatabase } from '@cerc-io/graph-node';
|
||||
|
||||
import { Database } from '../../database';
|
||||
@@ -24,7 +24,7 @@ export const builder = {
|
||||
};
|
||||
|
||||
export const handler = async (argv: any): Promise<void> => {
|
||||
const config = await getConfig(argv.configFile);
|
||||
const config: Config = await getConfig(argv.configFile);
|
||||
await resetJobs(config);
|
||||
const { ethClient, ethProvider } = await initClients(config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user