Skip to content

Commit

Permalink
fix: skipPaging option is not behaving as described. Increase the upd…
Browse files Browse the repository at this point in the history
…atedAfter timestamp period to 12h.
  • Loading branch information
nshandra committed Dec 9, 2024
1 parent be49cd4 commit f017816
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/data/enrollments/EnrollmentsD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class EnrollmentsD2Repository implements EnrollmentsRepository {
}

async getRecentlyUpdated(params: EnrollmentsRepositoryParams): Async<Enrollment[]> {
const updatedAfter = getOneHourAgoDate();
const updatedAfter = getTwelveHoursAgoDate();
return this.getEnrollments({ ...params, updatedAfter });
}

Expand Down Expand Up @@ -135,8 +135,8 @@ export type getEnrollmentsParams = {
updatedAfter?: string;
};

function getOneHourAgoDate() {
function getTwelveHoursAgoDate() {
const today = new Date();
const updatedAfter = new Date(today.getTime() - 1 * 60 * 60 * 1000).toISOString().replace("Z", "");
const updatedAfter = new Date(today.getTime() - 12 * 60 * 60 * 1000).toISOString().replace("Z", "");
return updatedAfter;
}
3 changes: 3 additions & 0 deletions src/data/enrollments/EventsD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class EventsD2Repository implements EventsRepository {
enrollmentStatus: true,
},
skipPaging: true,
// NOTE: Fix for 2.37.8.1
page: 1,
pageSize: 100000,
})
.getData()) as { instances: Event[] };

Expand Down

0 comments on commit f017816

Please sign in to comment.