Skip to content

Commit

Permalink
Differentiate the date limit used for performance from one used for c…
Browse files Browse the repository at this point in the history
…orrectness #3234
  • Loading branch information
davidcmoulton committed May 10, 2024
1 parent 24e9cab commit 05ffab7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -14,11 +14,11 @@ type Ports = {

export const discoverEvaluationsFromHypothesisGroup = (
publisherGroupId: string,
daysToLookBack: number | Date = 5,
earliestPublicationDateToConsider?: Date,
): DiscoverPublishedEvaluations => (ports: Ports) => pipe(
publisherGroupId,
Hyp.fetchEvaluationsByGroupSince(
daysToLookBack instanceof Date ? daysToLookBack : daysAgo(daysToLookBack),
earliestPublicationDateToConsider instanceof Date ? earliestPublicationDateToConsider : daysAgo(5),
ports.fetchData,
),
TE.map(RA.map(convertHypothesisAnnotationToEvaluation(tagToEvaluationTypeMap))),
Expand Down
Expand Up @@ -13,10 +13,11 @@ type Ports = {
};

export const discoverEvaluationsFromHypothesisUser = (
publisherUserId: string, days = 5,
publisherUserId: string,
daysToLookBackForAcceptablePerformance = 5,
): DiscoverPublishedEvaluations => (ports: Ports) => pipe(
publisherUserId,
Hyp.fetchEvaluationsByUserSince(daysAgo(days), ports.fetchData),
Hyp.fetchEvaluationsByUserSince(daysAgo(daysToLookBackForAcceptablePerformance), ports.fetchData),
TE.map(RA.map(convertHypothesisAnnotationToEvaluation(tagToEvaluationTypeMap))),
TE.map((parts) => ({
understood: RA.rights(parts),
Expand Down

0 comments on commit 05ffab7

Please sign in to comment.