cleanup users

This commit is contained in:
j 2019-02-23 12:32:20 +05:30
parent 739cfd8c9d
commit 08a3477e88

View file

@ -446,6 +446,9 @@ def cleanup_peers():
other_peers[id] = peer.info['peers'][id]
known_peers.add(id)
for u in user.models.User.query.filter(user.models.User.id.notin_(list(known_peers))):
if not 'local' in u.info and not u.pending:
if state.nodes and u.id in state.nodes.local:
continue
if not u.pending:
state.db.session.delete(u)
state.db.session.commit()