mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt.: mem usage
This commit is contained in:
@@ -109,8 +109,8 @@ Cpus parseBsdCpu(String raw) {
|
||||
.allMatches(raw)
|
||||
.map((e) => double.parse(e.group(1) ?? '0') * 100)
|
||||
.toList();
|
||||
if (percents.length != 3) return initCpuStatus;
|
||||
return initCpuStatus
|
||||
if (percents.length != 3) return InitStatus.cpus;
|
||||
return InitStatus.cpus
|
||||
..now = [
|
||||
OneTimeCpuStatus('cpu', percents[0].toInt(), 0, 0,
|
||||
percents[2].toInt() + percents[1].toInt(), 0, 0, 0)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import '../../../locator.dart';
|
||||
import '../../store/setting.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
|
||||
class TryLimiter {
|
||||
final Map<String, int> _triedTimes = {};
|
||||
|
||||
bool canTry(String id) {
|
||||
final maxCount = locator<SettingStore>().maxRetryCount.fetch();
|
||||
final maxCount = Stores.setting.maxRetryCount.fetch();
|
||||
if (maxCount <= 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user