Skip to content

Commit

Permalink
server: Remove the FirstBlockSynchronizerTask
Browse files Browse the repository at this point in the history
The same job can be done by the BackwardsSynchronizerTask, there is no
need to keep both.
  • Loading branch information
AlexITC committed Jun 10, 2018
1 parent 3a8d3cb commit 032fac4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 130 deletions.
124 changes: 0 additions & 124 deletions server/app/com/xsn/explorer/tasks/FirstBlockSynchronizerTask.scala

This file was deleted.

9 changes: 3 additions & 6 deletions server/app/com/xsn/explorer/tasks/SQSSeederTask.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import scala.util.{Failure, Success}
class SQSSeederTask @Inject() (
config: SeederConfig,
blockEventsProcessor: BlockEventsProcessor,
firstBlockSynchronizerTask: FirstBlockSynchronizerTask,
backwardsSynchronizerTask: BackwardsSynchronizerTask)(
implicit sqs: AmazonSQSAsync,
materializer: Materializer) {
Expand Down Expand Up @@ -92,14 +91,12 @@ class SQSSeederTask @Inject() (
}

private def onBlockResult(eventResult: BlockEventsProcessor.Result) = eventResult match {
case BlockEventsProcessor.FirstBlockCreated(_) =>
firstBlockSynchronizerTask.sync()
case BlockEventsProcessor.FirstBlockCreated(block) =>
backwardsSynchronizerTask.sync(block)

case BlockEventsProcessor.NewBlockAppended(_) =>
firstBlockSynchronizerTask.sync()
case BlockEventsProcessor.NewBlockAppended(_) => ()

case BlockEventsProcessor.RechainDone(_, newBlock) =>
firstBlockSynchronizerTask.sync()
backwardsSynchronizerTask.sync(newBlock)

case BlockEventsProcessor.MissingBlockProcessed(block) =>
Expand Down

0 comments on commit 032fac4

Please sign in to comment.