Skip to content

Commit

Permalink
fix: SKFP-1077 remove usage of env vars for members count (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
aperron-ferlab authored May 22, 2024
1 parent 0d31f3e commit 19a3eeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/endpoints/statistics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import filesize from 'filesize';
import EsInstance from '../../ElasticSearchClientInstance';
import {
esFileIndex,
esMembersIndex,
esParticipantIndex,
esPublicMemberIndex,
esStudyIndex,
esVariantIndex,
familyIdKey,
Expand Down Expand Up @@ -301,11 +299,11 @@ export const fetchMemberStats = async (client: Client): Promise<MembersCount> =>
if (project === PROJECT_INCLUDE) return;

const { body: members } = await client.count({
index: esMembersIndex,
index: 'members',
});

const { body: publicMembers } = await client.count({
index: esPublicMemberIndex,
index: 'members-public',
});
return {
totalCount: members?.count,
Expand All @@ -331,6 +329,7 @@ export const getStatistics = async (): Promise<Statistics> => {
const diagnosis = await fetchTopDiagnosis(client);

const members = await fetchMemberStats(client);

return {
files: results[0],
studies: results[1],
Expand Down
4 changes: 0 additions & 4 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export const esParticipantIndex = process.env.ES_PARTICIPANT_INDEX || 'participa
export const esBiospecimenIndex = process.env.ES_BIOSPECIMEN_INDEX || 'biospecimen_centric';
export const esVariantIndex = process.env.ES_VARIANT_INDEX || 'variant_centric';

export const esMembersIndex = process.env.ES_MEMBERS_INDEX || 'members';

export const esPublicMemberIndex = process.env.ES_PUBLIC_MEMBERS_INDEX || 'members-public';

export const maxNOfGenomicFeatureSuggestions = process.env.MAX_NUMBER_OF_GF_SUGGESTIONS || 5;

export const indexNameGeneFeatureSuggestion = process.env.GENES_SUGGESTIONS_INDEX_NAME;
Expand Down

0 comments on commit 19a3eeb

Please sign in to comment.