Skip to content

Commit

Permalink
externalize conf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodeur committed Oct 2, 2017
1 parent 5bb1a34 commit 333dbae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions docker/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ MAINTAINER nicodeur <[email protected]>

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
11 changes: 5 additions & 6 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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) {
Expand Down Expand Up @@ -302,7 +301,7 @@ function getInfoCordonBleu(callback, team, dateDebutStr, dateFinStr) {
});

callback(cordonBleuInfos);
});
}, semaphore);
}

cpt=cpt+1;
Expand All @@ -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);
}
}

0 comments on commit 333dbae

Please sign in to comment.