Skip to content

Commit

Permalink
fix: fix south opcua start time from cache after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerni10 committed Sep 13, 2024
1 parent 1f40d38 commit 7283f24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/src/south/south-opcua/south-opcua.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ describe('SouthOPCUA', () => {
const session = { performMessageTransaction } as unknown as ClientSession;

await south.start();
await south.getHAValues([items[0]], nowDateString, nowDateString, session, true);
await south.getHAValues([items[0]], nowDateString, nowDateString, nowDateString, session, true);
expect(performMessageTransaction).toHaveBeenCalled();
});
});
Expand Down
5 changes: 3 additions & 2 deletions backend/src/south/south-opcua/south-opcua.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class SouthOPCUA
.toUTC()
.toISO() as Instant;
const endTime = DateTime.now().toUTC().toISO() as Instant;
content = (await this.getHAValues([item], startTime, endTime, session, true)) as OIBusContent;
content = (await this.getHAValues([item], startTime, endTime, startTime, session, true)) as OIBusContent;
}
callback(content);
} catch (error: any) {
Expand Down Expand Up @@ -222,13 +222,14 @@ export default class SouthOPCUA
this.logger.error('OPCUA session not set. The connector cannot read values');
return startTime;
}
return (await this.getHAValues(items, startTime, endTime, session)) as Instant;
return (await this.getHAValues(items, startTime, endTime, startTimeFromCache, session)) as Instant;
}

async getHAValues(
items: Array<SouthConnectorItemDTO<SouthOPCUAItemSettings>>,
startTime: Instant,
endTime: Instant,
startTimeFromCache: Instant,
session: ClientSession,
testingItem: boolean = false
): Promise<Instant | OIBusContent> {
Expand Down

0 comments on commit 7283f24

Please sign in to comment.