Allow waiting in updating records

This commit is contained in:
Mygod
2019-01-06 00:55:57 +08:00
parent ea9145c2bd
commit 0374b93a64
2 changed files with 7 additions and 1 deletions

View File

@@ -64,7 +64,7 @@ object TrafficRecorder {
private fun doUpdate(timestamp: Long) {
val oldRecords = LongSparseArray<TrafficRecord>()
loop@ for (line in RootSession.use { it.execOutUnjoined("$IPTABLES -nvx -L vpnhotspot_fwd").drop(2) }) {
loop@ for (line in RootSession.use { it.execOutUnjoinedWithWait("$IPTABLES -nvx -L vpnhotspot_fwd").drop(2) }) {
val columns = line.split("\\s+".toRegex()).filter { it.isNotEmpty() }
try {
check(columns.size >= 9)