Skip to content

Commit

Permalink
Merge pull request #548 from IATI/speed_up_validation_report
Browse files Browse the repository at this point in the history
Speed up generation of validation report
  • Loading branch information
simon-20 authored Mar 12, 2024
2 parents a88ac3d + 1103b0d commit 769bcd5
Show file tree
Hide file tree
Showing 15 changed files with 2,887 additions and 32 deletions.
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ APPLICATIONINSIGHTS_CONNECTION_STRING=

BASIC_GITHUB_TOKEN=

REDIS_CACHE_SEC=60
REDIS_PORT=6379
REDIS_KEY=
REDIS_HOSTNAME=
REDIS_HOSTNAME=redis # replace with localhost if you run outside docker

VALIDATOR_SERVICES_URL=https://dev-func-validator-services.azurewebsites.net/api
VALIDATOR_SERVICES_KEY_NAME=x-functions-key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/develop-func-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: 'Install Dependencies with Npm'
run: |
npm i -g npm
npm i -g npm@8.19.4
npm ci
- name: 'Run unit tests'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ COPY . /home/site/wwwroot
# Install node_modules
WORKDIR /home/site/wwwroot
RUN \
npm i -g npm && \
npm i -g npm@8.19.4 && \
npm pkg delete scripts.prepare && \
npm ci --production
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ BASIC_GITHUB_TOKEN

- 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.

REDIS_CACHE_SEC=60
REDIS_PORT=6379
REDIS_KEY=
REDIS_HOSTNAME=
REDIS_HOSTNAME=redis

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

VALIDATOR_SERVICES_URL=https://func-validator-services-dev.azurewebsites.net/api
VALIDATOR_SERVICES_KEY_NAME=x-functions-key
Expand Down
6 changes: 5 additions & 1 deletion config/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ if (config.REDIS_KEY && config.REDIS_HOSTNAME) {
},
},
};
} else {
connectionOptions = {
url: `redis://${config.REDIS_HOSTNAME}:${config.REDIS_PORT}`
};
}
const client = createClient(connectionOptions);
client.on('ready', () => {
console.log({
name: 'redisConnect',
value: `Redis: Connection to ${config.REDIS_HOSTNAME || 'local'} ready`,
value: `Redis: Connection to ${config.REDIS_HOSTNAME} ready`,
});
});
client.on('error', (err) => {
Expand Down
Loading

0 comments on commit 769bcd5

Please sign in to comment.