Commit 0dda31d
committed
Drop real-time sleep from MockMicrogridApiClient::new()
`new()` slept up to ~1 s of wall-clock time aligning to the next whole
second so the mock's telemetry timestamps would land on the resampler's
interval boundaries. The anchor is now built directly from
`next_sec_secs` and handed to `TokioSyncedClock::with_wall_anchor`, so
the boundary is reported at construction without waiting for real time
to reach it. The sleep was incidentally syncing the mock's clock with a
later `TokioSyncedClock::new()` (anchored to `Utc::now()`) that
`new_logical_meter_handle` was passing to `LogicalMeterHandle`; expose
the mock's clock via a new `clock()` accessor and share it with the
actor so the two sides remain aligned without depending on real wall
time.
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>1 parent 0a2aa96 commit 0dda31d
2 files changed
Lines changed: 16 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
258 | 257 | | |
259 | | - | |
260 | | - | |
| 258 | + | |
261 | 259 | | |
262 | 260 | | |
263 | 261 | | |
264 | | - | |
265 | | - | |
266 | 262 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
271 | 266 | | |
272 | 267 | | |
273 | 268 | | |
274 | 269 | | |
275 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
247 | | - | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
0 commit comments