Skip to content

Commit

Permalink
Fix report
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Feb 24, 2025
1 parent 0070755 commit f458884
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/server/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,14 @@ Future<Map<String, Object?>> _getReport({required Database db, required DateTime

var _$GET$ReportCache = (0, Future.value(const <String, Object?>{}));
Future<Response> $GET$Report(Request request) async {
final now = DateTime.now();
final now = DateTime.now().subtract(const Duration(days: 1));
final date = DateTime(now.year, now.month, now.day);
final value = (date.year << 9) | (date.month << 5) | date.day;
if (value == _$GET$ReportCache.$1) return Responses.ok(await _$GET$ReportCache.$2);
final result = _getReport(
db: Dependencies.of(request).database,
from: date.subtract(const Duration(days: 1)),
to: date,
from: date.subtract(const Duration(days: 2)), // Day before yesterday
to: date.subtract(const Duration(days: 1)), // Yesterday
);
_$GET$ReportCache = (value, result);
return Responses.ok(await result);
Expand Down

0 comments on commit f458884

Please sign in to comment.