touch method
Records that this process just acted on deviceId, at most every 30 s, so others can tell a busy claim from an idle one.
Implementation
void touch(String deviceId) {
final now = DateTime.now();
final before = _touched[deviceId];
if (before != null && now.difference(before) < const Duration(seconds: 30)) return;
_touched[deviceId] = now;
try {
final f = _file(deviceId);
final j = jsonDecode(f.readAsStringSync()) as Map<String, Object?>;
if ((j['pid'] as num).toInt() != ownPid) return;
f.writeAsStringSync(jsonEncode({...j, 'last': now.toIso8601String()}));
} on Object {
// no claim file means nothing to keep fresh
}
}