Skip to content

Commit ff64853

Browse files
committed
Improve logging
1 parent 3cdd290 commit ff64853

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ def post(self):
318318
if ALLOW_PUBLIC_BOOKMARKS:
319319
username = "public"
320320
else:
321+
app.logger.debug("Rejecting attempt to store bookmark as public user")
321322
return jsonify({"success": False})
322323

323324
args = userbookmark_parser.parse_args()
@@ -374,6 +375,8 @@ def post(self):
374375
hexdigest = hashlib.sha224((datastr + str(random.random())).encode('utf-8')).hexdigest()[0:9]
375376
attempts += 1
376377

378+
if attempts >= 100:
379+
app.logger.debug("More than 100 failed attempts to store bookmark")
377380
return jsonify({"success": attempts < 100})
378381

379382
@bk.route('/<key>')

0 commit comments

Comments
 (0)