|
...
|
...
|
@@ -80,6 +80,7 @@ void main() { |
|
|
|
);
|
|
|
|
|
|
|
|
api.calls.clear();
|
|
|
|
store.realtimeNotificationWindowQueryCount = 0;
|
|
|
|
final second = await service.startCoreCaculate(
|
|
|
|
endTime: base + 800,
|
|
|
|
readChunkDays: 1,
|
|
...
|
...
|
@@ -90,6 +91,7 @@ void main() { |
|
|
|
second.realtimeStressPoints.map((e) => e.rawEndTime),
|
|
|
|
[base + 720],
|
|
|
|
);
|
|
|
|
expect(store.realtimeNotificationWindowQueryCount, 0);
|
|
|
|
expect(
|
|
|
|
api.firstCallStart(HealthDataUploadType.hrv.type),
|
|
|
|
lessThanOrEqualTo(base + 120),
|
|
...
|
...
|
@@ -869,6 +871,7 @@ class _MemoryHealthRawStressLocalStore extends HealthRawStressLocalStore { |
|
|
|
final Map<int, List<HealthRawDailyStressPoint>> _daily = {};
|
|
|
|
final Map<int, List<HealthRawSleepResult>> _sleep = {};
|
|
|
|
final List<String> operationLog;
|
|
|
|
var realtimeNotificationWindowQueryCount = 0;
|
|
|
|
|
|
|
|
void insertDailyStress(HealthRawDailyStressPoint point) {
|
|
|
|
final byDate = <int, HealthRawDailyStressPoint>{
|
|
...
|
...
|
@@ -1039,6 +1042,9 @@ class _MemoryHealthRawStressLocalStore extends HealthRawStressLocalStore { |
|
|
|
required int endTime,
|
|
|
|
}) async {
|
|
|
|
operationLog.add('queryRealtimeStressPoints');
|
|
|
|
if (endTime - startTime <= Duration.secondsPerHour) {
|
|
|
|
realtimeNotificationWindowQueryCount += 1;
|
|
|
|
}
|
|
|
|
return (_realtime[userId] ?? <HealthRawRealtimeStressPoint>[])
|
|
|
|
.where((e) => e.rawEndTime >= startTime && e.rawEndTime <= endTime)
|
|
|
|
.toList();
|
...
|
...
|
|