tkrs / fluflu

@@ -61,8 +61,7 @@
Loading
61 61
62 62
        def run(): Unit = {
63 63
          def ignore = closed || queue.isEmpty
64 -
          if (ignore)
65 -
            running.set(false)
64 +
          if (ignore) running.set(false)
66 65
          else {
67 66
            consumer.consume()
68 67
            if (ignore)
@@ -74,8 +73,7 @@
Loading
74 73
      }
75 74
76 75
      def emit[A: Packer](tag: String, record: A, time: Instant): Either[Exception, Unit] =
77 -
        if (closed || worker.isShutdown)
78 -
          Left(new Exception("Client executor was already shutdown"))
76 +
        if (closed || worker.isShutdown) Left(new Exception("Client executor was already shutdown"))
79 77
        else {
80 78
          logger.trace(s"Queueing message: ${(tag, record, time)}")
81 79
          val fa = (p: MessageBufferPacker) => Packer[(A, Instant)].apply((record, time), p)

@@ -9,11 +9,13 @@
Loading
9 9
private[fluflu] object Utils {
10 10
  def awaitTermination(pool: ExecutorService, delay: FiniteDuration): Unit = {
11 11
    pool.shutdown()
12 -
    try if (!pool.awaitTermination(delay.toNanos, NANOSECONDS)) {
13 -
      pool.shutdownNow()
14 -
      if (!pool.awaitTermination(delay.toNanos, NANOSECONDS))
15 -
        throw new Exception("Pool did not terminate")
16 -
    } catch {
12 +
    try
13 +
      if (!pool.awaitTermination(delay.toNanos, NANOSECONDS)) {
14 +
        pool.shutdownNow()
15 +
        if (!pool.awaitTermination(delay.toNanos, NANOSECONDS))
16 +
          throw new Exception("Pool did not terminate")
17 +
      }
18 +
    catch {
17 19
      case _: InterruptedException =>
18 20
        pool.shutdownNow()
19 21
        Thread.currentThread().interrupt()

@@ -88,8 +88,9 @@
Loading
88 88
89 89
    @tailrec private def doConnect(ch: SocketChannel, retries: Int, sleeper: Sleeper): Try[SocketChannel] = {
90 90
      logger.info(s"Start connecting to $remote. retries: $retries")
91 -
      try if (ch.connect(remote)) Success(ch)
92 -
      else Failure(new IOException(s"Failed to connect: $remote"))
91 +
      try
92 +
        if (ch.connect(remote)) Success(ch)
93 +
        else Failure(new IOException(s"Failed to connect: $remote"))
93 94
      catch {
94 95
        case e: IOException =>
95 96
          if (sleeper.giveUp) {
Files Coverage
modules 53.72%
Project Totals (10 files) 53.72%
1346839038
unittests
1346839038
unittests

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading