summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Root <root@customs.hackerspace.pl>2018-06-27 11:35:03 +0200
committerCharlie Root <root@customs.hackerspace.pl>2018-06-27 11:35:03 +0200
commit35e30cd74ae17584eedbee5aa50a1c7fa843baf9 (patch)
treecce0f07abd933e4a5da44b4dd0cc7f9056ca28db
parentc3f185cea6b9d0baf822c0d40cce9991d4c0a354 (diff)
downloadcheckinator-35e30cd74ae17584eedbee5aa50a1c7fa843baf9.tar.gz
checkinator-35e30cd74ae17584eedbee5aa50a1c7fa843baf9.tar.bz2
checkinator-35e30cd74ae17584eedbee5aa50a1c7fa843baf9.zip
Fix missing entries
-rw-r--r--at.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/at.py b/at.py
index 6839c60..1fd0b5c 100644
--- a/at.py
+++ b/at.py
@@ -136,10 +136,11 @@ class Updater(threading.Thread):
else:
atime = time()
self.lock.acquire()
- self.active[hwaddr] = (atime, ip, name)
+ if hwaddr not in self.active or self.active[hwaddr][0] < atime:
+ self.active[hwaddr] = (atime, ip, name)
+ app.logger.info('updated %s with atime %s and ip %s',
+ hwaddr, strfts(atime), ip)
self.lock.release()
- app.logger.info('updated %s with atime %s and ip %s',
- hwaddr, strfts(atime), ip)
class CapUpdater(Updater):