Skip to content

Commit 8ab3050

Browse files
committed
undo test codes
1 parent 9309415 commit 8ab3050

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

cmd/committer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ func RunCommitter(cmd *cobra.Command, args []string) {
3232
committer.Init()
3333
committer.InitReorg()
3434

35-
committer.RunReorgValidator()
36-
// committer.CommitStreaming()
35+
go committer.RunReorgValidator()
36+
committer.CommitStreaming()
3737
}

internal/committer/reorg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func RunReorgValidator() {
3333
continue
3434
}
3535

36-
if endBlock-startBlock < 100 {
36+
if endBlock == lastBlockCheck || endBlock-startBlock < 100 {
3737
log.Debug().Int64("last_block_check", lastBlockCheck).Int64("start_block", startBlock).Int64("end_block", endBlock).Msg("Not enough new blocks to check. Sleeping for 1 minute.")
3838
time.Sleep(1 * time.Minute)
3939
continue

internal/libs/redis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
var RedisClient *redis.Client
1414

15-
const RedisReorgLastValidBlock = "reorg_last_valid_debug"
15+
const RedisReorgLastValidBlock = "reorg_last_valid"
1616

1717
// InitRedis initializes the Redis client
1818
func InitRedis() {

internal/storage/kafka_publisher.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,9 @@ func (p *KafkaPublisher) publishBlockData(blockData []*common.BlockData, isDelet
232232
return nil
233233
}
234234

235-
// test code, uncomment later
236-
// if err := p.publishMessages(context.Background(), blockMessages); err != nil {
237-
// return fmt.Errorf("failed to publish block messages: %v", err)
238-
// }
235+
if err := p.publishMessages(context.Background(), blockMessages); err != nil {
236+
return fmt.Errorf("failed to publish block messages: %v", err)
237+
}
239238

240239
log.Debug().Str("metric", "publish_duration").Msgf("Publisher.PublishBlockData duration: %f", time.Since(publishStart).Seconds())
241240
return nil

0 commit comments

Comments
 (0)