diff --git a/routers/lib/database.py b/routers/lib/database.py index 1ad9248..2a16894 100644 --- a/routers/lib/database.py +++ b/routers/lib/database.py @@ -161,7 +161,13 @@ def add_log(cik, message, name="", identifier=""): logs.update_one({"cik": cik}, {"$push": {"logs": log_string}}) else: logs_string = [f"{log} ({name}) ({identifier})" for log in message.split("\n")] - logs.update_one({"cik": cik}, {"$push": {"logs": {"$each": logs_string}}}) + logs.update_one( + {"cik": cik}, + { + "$push": {"logs": {"$each": logs_string}}, + "$set": {"logs": {"$slice": -100}}, + }, + ) def add_logs(cik, formatted_logs): @@ -174,7 +180,10 @@ def add_logs(cik, formatted_logs): ] ) - logs.update_one({"cik": cik}, {"$push": {"logs": {"$each": logs_split}}}) + logs.update_one( + {"cik": cik}, + {"$push": {"logs": {"$each": logs_split}}, "$set": {"logs": {"$slice": -100}}}, + ) def edit_log(cik, stamp): diff --git a/static/popular.json b/static/popular.json index 70c91fc..87d288e 100644 --- a/static/popular.json +++ b/static/popular.json @@ -1 +1 @@ -["1067983", "1649339", "1541617", "1336528", "1709323", "1536411", "1037389", "1791786", "1350694", "1167483"] \ No newline at end of file +["1067983", "1649339", "1541617", "1336528", "1709323", "1536411", "1037389", "1791786", "1350694", "1167483", "1037389"] \ No newline at end of file