Kherel 2 years ago
parent cd49f9fb45
commit 6726c87de7
  1. 2
      lib/logic/cubit/hetzner_metrics/hetzner_metrics_cubit.dart
  2. 3
      lib/logic/cubit/hetzner_metrics/hetzner_metrics_repository.dart

@ -38,7 +38,7 @@ class HetznerMetricsCubit extends Cubit<HetznerMetricsState> {
}
void load(Period period) async {
var newState = await repository.getMetrics(state.period);
var newState = await repository.getMetrics(period);
timer = Timer(
Duration(seconds: newState.stepInSeconds.toInt()),
() => load(newState.period),

@ -6,6 +6,7 @@ import 'hetzner_metrics_cubit.dart';
class HetznerMetricsRepository {
Future<HetznerMetricsLoaded> getMetrics(Period period) async {
print(period);
var end = DateTime.now();
DateTime start;
@ -21,7 +22,7 @@ class HetznerMetricsRepository {
break;
}
var api = HetznerApi();
var api = HetznerApi(hasLoger: true);
var results = await Future.wait([
api.getMetrics(start, end, 'cpu'),

Loading…
Cancel
Save