mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-17 22:29:15 +00:00
fix
This commit is contained in:
parent
cd49f9fb45
commit
6726c87de7
|
@ -38,7 +38,7 @@ class HetznerMetricsCubit extends Cubit<HetznerMetricsState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void load(Period period) async {
|
void load(Period period) async {
|
||||||
var newState = await repository.getMetrics(state.period);
|
var newState = await repository.getMetrics(period);
|
||||||
timer = Timer(
|
timer = Timer(
|
||||||
Duration(seconds: newState.stepInSeconds.toInt()),
|
Duration(seconds: newState.stepInSeconds.toInt()),
|
||||||
() => load(newState.period),
|
() => load(newState.period),
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'hetzner_metrics_cubit.dart';
|
||||||
|
|
||||||
class HetznerMetricsRepository {
|
class HetznerMetricsRepository {
|
||||||
Future<HetznerMetricsLoaded> getMetrics(Period period) async {
|
Future<HetznerMetricsLoaded> getMetrics(Period period) async {
|
||||||
|
print(period);
|
||||||
var end = DateTime.now();
|
var end = DateTime.now();
|
||||||
DateTime start;
|
DateTime start;
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ class HetznerMetricsRepository {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var api = HetznerApi();
|
var api = HetznerApi(hasLoger: true);
|
||||||
|
|
||||||
var results = await Future.wait([
|
var results = await Future.wait([
|
||||||
api.getMetrics(start, end, 'cpu'),
|
api.getMetrics(start, end, 'cpu'),
|
||||||
|
|
Loading…
Reference in a new issue