misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2019-10-23 19:08:43 +02:00
parent f734c9cd68
commit eda8a18788
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E
2 changed files with 2 additions and 1 deletions
pwnagotchi/mesh

@ -12,7 +12,7 @@ def parse_rfc3339(dt):
class Peer(object):
def __init__(self, obj):
now = time.time()
just_met = datetime.now().strftime("%Y-%m-%dT%H:%M:%S")
just_met = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S")
self.first_met = parse_rfc3339(obj.get('met_at', just_met))
self.first_seen = parse_rfc3339(obj.get('detected_at', just_met))
self.prev_seen = parse_rfc3339(obj.get('prev_seen_at', just_met))

@ -100,5 +100,6 @@ class AsyncAdvertiser(object):
except Exception as e:
logging.warning("error while polling pwngrid-peer: %s" % e)
logging.debug(e, exc_info=True)
time.sleep(1)