Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
fix: use correct nightscout client to fetch latest import dates
Browse files Browse the repository at this point in the history
  • Loading branch information
burnedikt committed Jan 30, 2023
1 parent a066fa9 commit d3fb003
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export function startSynchronization({
pollingIntervalMs,
async () => {
// identify lower time limit (= last known earliest record imported from diasend to nightscout)
const latestImportDates = await fetchLatestImportDatesByTreatmentType();
const latestImportDates = await fetchLatestImportDatesByTreatmentType(
nightscoutClient
);

// to determine date from fetching, ignore the SGV values
let dateFrom =
Expand Down Expand Up @@ -239,7 +241,7 @@ type LatestImportDatesByTreatmentType = {
};

async function fetchLatestImportDatesByTreatmentType(
nightscoutClient = getNightscoutHttpClient()
nightscoutClient: NightscoutClient
): Promise<LatestImportDatesByTreatmentType> {
// check for latest import dates of all treatment types ...
const treatmentTypesLatestImportDates = treatmentTypes
Expand Down

0 comments on commit d3fb003

Please sign in to comment.