From 333dbae249c04943ed1c91cecd570e27b3ebe3f6 Mon Sep 17 00:00:00 2001 From: Nicolas Deblock Date: Mon, 2 Oct 2017 16:49:37 +0200 Subject: [PATCH] externalize conf.js --- conf/{conf.js => conf.js.exemple} | 0 docker/latest/Dockerfile | 4 ++-- server/server.js | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) rename conf/{conf.js => conf.js.exemple} (100%) diff --git a/conf/conf.js b/conf/conf.js.exemple similarity index 100% rename from conf/conf.js rename to conf/conf.js.exemple diff --git a/docker/latest/Dockerfile b/docker/latest/Dockerfile index d9c0b64..f12bf21 100644 --- a/docker/latest/Dockerfile +++ b/docker/latest/Dockerfile @@ -3,14 +3,14 @@ MAINTAINER nicodeur RUN apk update && apk add --update git nodejs nodejs-npm && npm install npm@latest -g && rm -rf /var/cache/apk/* -RUN git clone https://github.com/nicodeur/QualityDashboard.git /opt/qualityReport && echo "10" +RUN git clone https://github.com/nicodeur/QualityDashboard.git /opt/qualityReport && echo "11" RUN cd /opt/qualityReport && chmod 755 installDependencies.sh && ./installDependencies.sh WORKDIR /opt/qualityReport -CMD chmod 755 start.sh && chmod 755 front/start.sh && chmod 755 server/start.sh && \ +CMD chmod 755 start.sh && chmod 755 front/start.sh && chmod 755 server/start.sh && chmod 755 stop.sh && chmod 755 restart.sh &&\ ./start.sh && tail -f logs/server.log EXPOSE 8085 8086 diff --git a/server/server.js b/server/server.js index 0d05a14..2c1046e 100644 --- a/server/server.js +++ b/server/server.js @@ -230,10 +230,9 @@ function SortByName(a, b){ -var semaphore=0; function getInfoCordonBleu(callback, team, dateDebutStr, dateFinStr) { // TODO varaiblisiser la chaine de connexion - MongoClient.connect("mongodb://192.168.134.148/cordonbleu", function(error, db) { + MongoClient.connect("mongodb://192.168.134.148/cordonbleu", {poolSize: 10}, function(error, db) { if (error) { console.log(error); } @@ -252,7 +251,7 @@ function getInfoCordonBleu(callback, team, dateDebutStr, dateFinStr) { let cpt = 0; let cordonBleuInfos = new Array(); - semaphore++; + let semaphore=1; teams.count(function (errorTeaemsCount, teamsSize) { teams.forEach(function (team) { @@ -302,7 +301,7 @@ function getInfoCordonBleu(callback, team, dateDebutStr, dateFinStr) { }); callback(cordonBleuInfos); - }); + }, semaphore); } cpt=cpt+1; @@ -312,10 +311,10 @@ function getInfoCordonBleu(callback, team, dateDebutStr, dateFinStr) { } -function wait_until_semaphore(callback) { +function wait_until_semaphore(callback, semaphore) { if (semaphore==0) { callback(); } else { - setTimeout(function(){wait_until_semaphore(callback)},100); + setTimeout(function(){wait_until_semaphore(callback, semaphore)},100); } }