From 6dd70542951ca60b4de633808108531db689b505 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 15 Apr 2020 17:25:55 +0100 Subject: [PATCH] Exit if too many lines --- webinterface.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webinterface.py b/webinterface.py index e6b21f56..48b36ce6 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5551,11 +5551,17 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str: if ' ' not in line: line = tagsFile.readline() lineCtr += 1 + # don't read too many lines + if lineCtr > 4: + break continue postDaysSinceEpochStr = line.split(' ')[0] if not postDaysSinceEpochStr.isdigit(): line = tagsFile.readline() lineCtr += 1 + # don't read too many lines + if lineCtr > 4: + break continue postDaysSinceEpoch = int(postDaysSinceEpochStr) if postDaysSinceEpoch < daysSinceEpoch: