parseCgroupV2 static method

int? parseCgroupV2(
  1. String? text
)

Reads cgroup v2 cpu.max: max 100000 (no limit) or 400000 100000. Returns null when there is no limit or the text is bad.

Implementation

static int? parseCgroupV2(String? text) {
  if (text == null) {
    return null;
  }
  List<String> parts = text.trim().split(RegExp(r'\s+'));
  if (parts.length != 2) {
    return null;
  }
  return _ceilQuota(int.tryParse(parts[0]), int.tryParse(parts[1]));
}