Skip to content

Commit

Permalink
prevent duplicating extra data
Browse files Browse the repository at this point in the history
  • Loading branch information
ngn13 committed Apr 5, 2024
1 parent 8f8bb24 commit 918b066
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ def db_add(self, ip: str, port: int, extra):

if not port in found["ports"]:
col.update_one({"ipv4": ip}, {"$push": {"ports": port}})

if len(extra.keys()) != 0:
col.update_one({"ipv4": ip}, {"$push": {"data": extra}})
if len(extra.keys()) != 0:
col.update_one({"ipv4": ip}, {"$push": {"data": extra}})

def set_handler(self, func):
self.handler = func
Expand Down

0 comments on commit 918b066

Please sign in to comment.