File tree 8 files changed +5
-346
lines changed
routes/configuration/cache
8 files changed +5
-346
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import { env } from "../shared/utils/env";
8
8
import { logger } from "../shared/utils/logger" ;
9
9
import { metricsServer } from "../shared/utils/prometheus" ;
10
10
import { withServerUsageReporting } from "../shared/utils/usage" ;
11
- import { updateTxListener } from "./listeners/update-tx-listener" ;
12
11
import { withAdminRoutes } from "./middleware/admin-routes" ;
13
12
import { withAuth } from "./middleware/auth" ;
14
13
import { withCors } from "./middleware/cors" ;
@@ -132,6 +131,5 @@ export const initServer = async () => {
132
131
} ) ;
133
132
134
133
writeOpenApiToFile ( server ) ;
135
- await updateTxListener ( ) ;
136
- await clearCacheCron ( "server" ) ;
134
+ await clearCacheCron ( ) ;
137
135
} ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export async function updateCacheConfiguration(fastify: FastifyInstance) {
47
47
await updateConfiguration ( { ...req . body } ) ;
48
48
const config = await getConfig ( false ) ;
49
49
// restarting cache cron with updated cron schedule
50
- await clearCacheCron ( "server" ) ;
50
+ await clearCacheCron ( ) ;
51
51
res . status ( StatusCodes . OK ) . send ( {
52
52
result : {
53
53
clearCacheCronSchedule : config . clearCacheCronSchedule ,
Original file line number Diff line number Diff line change 1
- import type { env } from "../env" ;
2
1
import { accessTokenCache } from "./access-token" ;
3
2
import { invalidateConfig } from "./get-config" ;
4
3
import { sdkCache } from "./get-sdk" ;
5
4
import { walletsCache } from "./get-wallet" ;
6
5
import { webhookCache } from "./get-webhook" ;
7
6
import { keypairCache } from "./keypair" ;
8
7
9
- export const clearCache = async (
10
- _service : ( typeof env ) [ "LOG_SERVICES" ] [ 0 ] ,
11
- ) : Promise < void > => {
8
+ export const clearCache = async ( ) : Promise < void > => {
12
9
invalidateConfig ( ) ;
13
10
webhookCache . clear ( ) ;
14
11
sdkCache . clear ( ) ;
Original file line number Diff line number Diff line change 1
1
import { CronJob } from "cron" ;
2
2
import { clearCache } from "../cache/clear-cache" ;
3
3
import { getConfig } from "../cache/get-config" ;
4
- import type { env } from "../env" ;
5
4
6
5
let task : CronJob ;
7
6
8
- export const clearCacheCron = async (
9
- service : ( typeof env ) [ "LOG_SERVICES" ] [ 0 ] ,
10
- ) => {
7
+ export const clearCacheCron = async ( ) => {
11
8
const config = await getConfig ( ) ;
12
9
13
10
if ( ! config . clearCacheCronSchedule ) {
@@ -20,7 +17,7 @@ export const clearCacheCron = async (
20
17
}
21
18
22
19
task = new CronJob ( config . clearCacheCronSchedule , async ( ) => {
23
- await clearCache ( service ) ;
20
+ await clearCache ( ) ;
24
21
} ) ;
25
22
task . start ( ) ;
26
23
} ;
Original file line number Diff line number Diff line change 1
1
import { chainIndexerListener } from "./listeners/chain-indexer-listener" ;
2
- import {
3
- newConfigurationListener ,
4
- updatedConfigurationListener ,
5
- } from "./listeners/config-listener" ;
6
- import {
7
- newWebhooksListener ,
8
- updatedWebhooksListener ,
9
- } from "./listeners/webhook-listener" ;
10
2
import { initCancelRecycledNoncesWorker } from "./tasks/cancel-recycled-nonces-worker" ;
11
3
import { initMineTransactionWorker } from "./tasks/mine-transaction-worker" ;
12
4
import { initNonceHealthCheckWorker } from "./tasks/nonce-health-check-worker" ;
@@ -31,14 +23,6 @@ export const initWorker = async () => {
31
23
await initNonceResyncWorker ( ) ;
32
24
await initWalletSubscriptionWorker ( ) ;
33
25
34
- // Listen for new & updated configuration data.
35
- await newConfigurationListener ( ) ;
36
- await updatedConfigurationListener ( ) ;
37
-
38
- // Listen for new & updated webhooks data.
39
- await newWebhooksListener ( ) ;
40
- await updatedWebhooksListener ( ) ;
41
-
42
26
// Contract subscriptions.
43
27
await chainIndexerListener ( ) ;
44
28
} ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments