Skip to content

Commit 769bcd5

Browse files
authored
Merge pull request #548 from IATI/speed_up_validation_report
Speed up generation of validation report
2 parents a88ac3d + 1103b0d commit 769bcd5

15 files changed

+2887
-32
lines changed

.env.example

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ APPLICATIONINSIGHTS_CONNECTION_STRING=
44

55
BASIC_GITHUB_TOKEN=
66

7-
REDIS_CACHE_SEC=60
87
REDIS_PORT=6379
9-
REDIS_KEY=
10-
REDIS_HOSTNAME=
8+
REDIS_HOSTNAME=redis # replace with localhost if you run outside docker
119

1210
VALIDATOR_SERVICES_URL=https://dev-func-validator-services.azurewebsites.net/api
1311
VALIDATOR_SERVICES_KEY_NAME=x-functions-key

.github/workflows/develop-func-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: 'Install Dependencies with Npm'
3333
run: |
34-
npm i -g npm
34+
npm i -g npm@8.19.4
3535
npm ci
3636
3737
- name: 'Run unit tests'

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ COPY . /home/site/wwwroot
1414
# Install node_modules
1515
WORKDIR /home/site/wwwroot
1616
RUN \
17-
npm i -g npm && \
17+
npm i -g npm@8.19.4 && \
1818
npm pkg delete scripts.prepare && \
1919
npm ci --production

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,11 @@ BASIC_GITHUB_TOKEN
8787

8888
- GitHub personal access token. This is needed to pull in the Codelists from the `IATI/IATI-Validator-Codelists` repository. Note that you cannot use a "Personal Access Token (Classic)"; you must generate a fine-grained access token.
8989

90-
REDIS_CACHE_SEC=60
9190
REDIS_PORT=6379
92-
REDIS_KEY=
93-
REDIS_HOSTNAME=
91+
REDIS_HOSTNAME=redis
9492

95-
- Redis connection, leaving the default will connect to a locally installed instance if you have one.
93+
- Redis connection, configured for `docker compose use`. If you develop outside
94+
docker, change these settings as appropriate.
9695

9796
VALIDATOR_SERVICES_URL=https://func-validator-services-dev.azurewebsites.net/api
9897
VALIDATOR_SERVICES_KEY_NAME=x-functions-key

config/redis.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ if (config.REDIS_KEY && config.REDIS_HOSTNAME) {
2626
},
2727
},
2828
};
29+
} else {
30+
connectionOptions = {
31+
url: `redis://${config.REDIS_HOSTNAME}:${config.REDIS_PORT}`
32+
};
2933
}
3034
const client = createClient(connectionOptions);
3135
client.on('ready', () => {
3236
console.log({
3337
name: 'redisConnect',
34-
value: `Redis: Connection to ${config.REDIS_HOSTNAME || 'local'} ready`,
38+
value: `Redis: Connection to ${config.REDIS_HOSTNAME} ready`,
3539
});
3640
});
3741
client.on('error', (err) => {

0 commit comments

Comments
 (0)