Skip to content

Commit

Permalink
fix: convert sync period to milliseconds before subtracting from the …
Browse files Browse the repository at this point in the history
…current time
  • Loading branch information
njuguna-n authored Nov 1, 2024
1 parent 61ccd62 commit 5be2b00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mediator/src/controllers/openmrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SYNC_PERIOD } from '../../config'
export async function sync() {
try {
let now = Date.now();
let syncPeriod = parseInt(SYNC_PERIOD, 10);
let syncPeriod = parseInt(SYNC_PERIOD, 10) * 1000; // Convert seconds to milliseconds
let startTime = new Date(now - syncPeriod);

await syncPatients(startTime);
Expand Down

0 comments on commit 5be2b00

Please sign in to comment.