[bisq-network/bisq] Use the index of a seed node address in the list of nodes at the (#4445)

sqrrm notifications at github.com
Fri Aug 28 15:36:50 UTC 2020


@sqrrm approved this pull request.

utACK

Looks ok, but I'll leave a but in case @chimp1984 wants to act on my comment

> +        // We wrap our periodic check in a delay of 2 hours to avoid that we get
+        // triggered multiple times after a restart while being in the same hour. It can be that we miss our target
+        // hour during that delay but that is not considered problematic, the seed would just restart a bit longer than
+        // 24 hours.
+        int target = myIndex;
+        UserThread.runAfter(() -> {
+            // We check every hour if we are in the target hour.
+            UserThread.runPeriodically(() -> {
+                int currentHour = ZonedDateTime.ofInstant(Instant.now(), ZoneId.of("GMT0")).getHour();
+                if (currentHour == target) {
+                    log.warn("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
+                            "Shut down node at hour {}" +
+                            "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n", target);
+                    shutDown(gracefulShutDownHandler);
+                }
+            }, TimeUnit.MINUTES.toSeconds(10));

Why not use `CHECK_SHUTDOWN_SEC` here?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4445#pullrequestreview-477828395
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200828/70c3446e/attachment.html>


More information about the bisq-github mailing list