Skip to content

Commit cb60121

Browse files
authored
Merge pull request #29 from ora-io/dev
Dev
2 parents f65586b + 887106e commit cb60121

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

packages/reku/src/event/crosschecker/autochecker.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,19 @@ export class AutoCrossChecker extends BaseCrossChecker {
8888

8989
const waitNextCrosscheck = async (): Promise<boolean> => {
9090
latestBlockNum = await timeoutWithRetry(() => this.provider.provider?.getBlockNumber(), 15 * 1000, 3)
91+
92+
// If auto-follow is enabled, update toBlock and check block range
9193
if (options.autoFollowLatestBlock) {
9294
ccrOptions.toBlock = latestBlockNum
95+
96+
// Check if the range exceeds the latest block number
97+
if (ccrOptions.fromBlock + batchBlocksCount + delayBlockFromLatest > latestBlockNum)
98+
return false
99+
93100
return true
94101
}
95102

103+
// If auto-follow is not enabled, check if toBlock is within the delay range
96104
if (ccrOptions.toBlock + delayBlockFromLatest > latestBlockNum) {
97105
// sleep until the toBlock
98106
// await sleep((ccrOptions.toBlock + delayBlockFromLatest - latestBlockNum) * blockInterval)

packages/utils/src/store/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export type { Store, StoreConfig, Stores } from 'cache-manager'
22
export { redisStore } from './redis'
3+
export type { RedisStore, RedisClusterConfig } from './redis'
34
export * from './manager'
45
export { memoryStore } from './memory'
56
export type { MemoryStore, MemoryCache, MemoryConfig } from './memory'

packages/utils/src/store/redis.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { RedisOptions } from 'ioredis'
22
import { Redis } from 'ioredis'
33
import type { Config } from 'cache-manager'
4+
import type { RedisStore } from 'cache-manager-ioredis-yet'
45
import { RedisClusterConfig, redisInsStore } from 'cache-manager-ioredis-yet'
56

67
export function redisStore(
@@ -22,3 +23,7 @@ export {
2223
RedisClusterConfig,
2324
redisInsStore,
2425
}
26+
27+
export type {
28+
RedisStore,
29+
}

packages/utils/src/store/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
import type { Keyv } from 'keyv'
2-
3-
export type Store = Keyv

0 commit comments

Comments
 (0)