def get_peers_derp(ip, key, path, version): print('check', ip, version) ident, peers = db.get_peers(key, version) if not peers: peers = get_all_peers(con(), path) print(('adding peers to db', len(peers))) ident, peers = db.set_peers(key, peers, version) else: print(('got db peers!', len(peers))) return peers, ident, ip
def get_peers_derp(ip,key,path,version): print('check',ip,version) ident,peers = db.get_peers(key,version) if not peers: peers = get_all_peers(con(), path) print(('adding peers to db',len(peers))) ident,peers = db.set_peers(key,peers,version) else: print(('got db peers!',len(peers))) return peers,ident,ip
def list_peers(environ): return dumps(db.get_peers(), indent=4)