Skip to content

Commit

Permalink
Check realtime mode in remote clock interceptor (#6985)
Browse files Browse the repository at this point in the history
* Revert Date.now() purge change
Check that the request is using realtime before using the remote-clock start and end timestamps for telemetry requests
* docs: clarify comment

---------

Co-authored-by: Jesse Mazzella <[email protected]>
  • Loading branch information
shefalijoshi and ozyx authored Oct 3, 2023
1 parent d53d8d5 commit ce59c0f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/plugins/remoteClock/requestInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ function remoteClockRequestInterceptor(openmct, _remoteClockIdentifier, waitForB
return activeClock?.key === 'remote-clock' && !remoteClockLoaded;
},
invoke: async (request) => {
const { start, end } = await waitForBounds();
remoteClockLoaded = true;
request.start = start;
request.end = end;
const timeContext = request?.timeContext ?? openmct.time;

// Wait for initial bounds if the request is for real-time data.
// Otherwise, use the bounds provided by the request.
if (timeContext.isRealTime()) {
const { start, end } = await waitForBounds();
remoteClockLoaded = true;
request.start = start;
request.end = end;
}

return request;
}
Expand Down

0 comments on commit ce59c0f

Please sign in to comment.