Fix missing entries

master
Charlie Root 2018-06-27 11:35:03 +02:00
parent c3f185cea6
commit 35e30cd74a
1 changed files with 4 additions and 3 deletions

7
at.py
View File

@ -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):