mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2025-01-18 19:41:36 -05:00
fix types, checkUpdate interval
This commit is contained in:
parent
ed0a389df2
commit
1b4f25cb9f
@ -1,9 +1,9 @@
|
|||||||
import { FastifyInstance } from 'fastify';
|
import { FastifyInstance } from 'fastify';
|
||||||
import { jobsSchema, statusSchema, withdrawBodySchema, withdrawSchema } from './schema';
|
import { jobsSchema, statusSchema, withdrawSchema } from './schema';
|
||||||
import { FromSchema } from 'json-schema-to-ts';
|
|
||||||
import { relayerVersion, rewardAccount, tornadoServiceFee } from '../config';
|
import { relayerVersion, rewardAccount, tornadoServiceFee } from '../config';
|
||||||
import { configService, getHealthService, getJobService, getPriceService } from '../services';
|
import { configService, getHealthService, getJobService, getPriceService } from '../services';
|
||||||
import { RelayerJobType } from '../types';
|
import { RelayerJobType } from '../types';
|
||||||
|
import { WithdrawalData } from '../services/tx.service';
|
||||||
|
|
||||||
export function mainHandler(server: FastifyInstance, options, next) {
|
export function mainHandler(server: FastifyInstance, options, next) {
|
||||||
const jobService = getJobService();
|
const jobService = getJobService();
|
||||||
@ -46,14 +46,10 @@ export function relayerHandler(server: FastifyInstance, options, next) {
|
|||||||
res.send({ ...job.data, failedReason: job.failedReason });
|
res.send({ ...job.data, failedReason: job.failedReason });
|
||||||
});
|
});
|
||||||
|
|
||||||
server.post<{ Body: FromSchema<typeof withdrawBodySchema> }>(
|
server.post<{ Body: WithdrawalData }>('/tornadoWithdraw', { schema: withdrawSchema }, async (req, res) => {
|
||||||
'/tornadoWithdraw',
|
server.log.info(`Withdrawal request: ${JSON.stringify(req.body)}`);
|
||||||
{ schema: withdrawSchema },
|
|
||||||
async (req, res) => {
|
|
||||||
console.log(req.body);
|
|
||||||
const id = await jobService.postJob(RelayerJobType.TORNADO_WITHDRAW, req.body);
|
const id = await jobService.postJob(RelayerJobType.TORNADO_WITHDRAW, req.body);
|
||||||
res.send({ id });
|
res.send({ id });
|
||||||
},
|
});
|
||||||
);
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ export class HealthQueueHelper {
|
|||||||
});
|
});
|
||||||
await this.queue.add('checkUpdate', null, {
|
await this.queue.add('checkUpdate', null, {
|
||||||
repeat: {
|
repeat: {
|
||||||
every: this.interval * 2,
|
every: this.interval * 2 * 60, // once per hour
|
||||||
immediately: true,
|
immediately: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user