mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 17:26:35 +00:00
Catch Hetzner metrics trying to emit when closed and disable logging.
This commit is contained in:
parent
11885b7ac7
commit
ef7d906504
|
@ -45,6 +45,10 @@ class HetznerMetricsCubit extends Cubit<HetznerMetricsState> {
|
||||||
() => load(newState.period),
|
() => load(newState.period),
|
||||||
);
|
);
|
||||||
|
|
||||||
emit(newState);
|
try {
|
||||||
|
emit(newState);
|
||||||
|
} on StateError {
|
||||||
|
print('Tried to emit Hetzner metrics when cubit is closed');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class HetznerMetricsRepository {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final HetznerApi api = HetznerApi(hasLogger: true);
|
final HetznerApi api = HetznerApi(hasLogger: false);
|
||||||
|
|
||||||
final List<Map<String, dynamic>> results = await Future.wait([
|
final List<Map<String, dynamic>> results = await Future.wait([
|
||||||
api.getMetrics(start, end, 'cpu'),
|
api.getMetrics(start, end, 'cpu'),
|
||||||
|
|
Loading…
Reference in a new issue