From f5a84ab40fc590bf29b3b55dad821682fcf04872 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Tue, 21 Nov 2017 02:11:55 -0500 Subject: [PATCH 1/2] prevent dotnet worker from consuming all cpu --- worker/src/Worker/Program.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worker/src/Worker/Program.cs b/worker/src/Worker/Program.cs index 634b937..25191aa 100644 --- a/worker/src/Worker/Program.cs +++ b/worker/src/Worker/Program.cs @@ -28,6 +28,9 @@ namespace Worker var definition = new { vote = "", voter_id = "" }; while (true) { + // Slow down to prevent CPU spike, only query each 100ms + Thread.Sleep(100); + // Reconnect redis if down if (redisConn == null || !redisConn.IsConnected) { Console.WriteLine("Reconnecting Redis"); From 9fa3e4360f4cc5dff2e6f7c592102d933b54fe65 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Tue, 21 Nov 2017 04:35:01 -0500 Subject: [PATCH 2/2] updating node versions and fixing result tests --- result/Dockerfile | 2 +- result/tests/Dockerfile | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/result/Dockerfile b/result/Dockerfile index d736db9..9ddc77b 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,4 +1,4 @@ -FROM node:5.11.0-slim +FROM node:8.9-slim WORKDIR /app diff --git a/result/tests/Dockerfile b/result/tests/Dockerfile index bca8c51..8d1b80e 100644 --- a/result/tests/Dockerfile +++ b/result/tests/Dockerfile @@ -1,5 +1,11 @@ -FROM node -RUN npm install -g phantomjs +FROM node:8.9-slim +RUN apt-get update -qq && apt-get install -qy \ + ca-certificates \ + bzip2 \ + curl \ + libfontconfig \ + --no-install-recommends +RUN yarn global add phantomjs-prebuilt ADD . /app WORKDIR /app CMD ["/app/tests.sh"]