Skip to content

Commit 032fac4

Browse files
committed
server: Remove the FirstBlockSynchronizerTask
The same job can be done by the BackwardsSynchronizerTask, there is no need to keep both.
1 parent 3a8d3cb commit 032fac4

File tree

2 files changed

+3
-130
lines changed

2 files changed

+3
-130
lines changed

server/app/com/xsn/explorer/tasks/FirstBlockSynchronizerTask.scala

-124
This file was deleted.

server/app/com/xsn/explorer/tasks/SQSSeederTask.scala

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import scala.util.{Failure, Success}
2222
class SQSSeederTask @Inject() (
2323
config: SeederConfig,
2424
blockEventsProcessor: BlockEventsProcessor,
25-
firstBlockSynchronizerTask: FirstBlockSynchronizerTask,
2625
backwardsSynchronizerTask: BackwardsSynchronizerTask)(
2726
implicit sqs: AmazonSQSAsync,
2827
materializer: Materializer) {
@@ -92,14 +91,12 @@ class SQSSeederTask @Inject() (
9291
}
9392

9493
private def onBlockResult(eventResult: BlockEventsProcessor.Result) = eventResult match {
95-
case BlockEventsProcessor.FirstBlockCreated(_) =>
96-
firstBlockSynchronizerTask.sync()
94+
case BlockEventsProcessor.FirstBlockCreated(block) =>
95+
backwardsSynchronizerTask.sync(block)
9796

98-
case BlockEventsProcessor.NewBlockAppended(_) =>
99-
firstBlockSynchronizerTask.sync()
97+
case BlockEventsProcessor.NewBlockAppended(_) => ()
10098

10199
case BlockEventsProcessor.RechainDone(_, newBlock) =>
102-
firstBlockSynchronizerTask.sync()
103100
backwardsSynchronizerTask.sync(newBlock)
104101

105102
case BlockEventsProcessor.MissingBlockProcessed(block) =>

0 commit comments

Comments
 (0)