Exit if too many lines

main
Bob Mottram 2020-04-15 17:25:55 +01:00
parent a3c287bfd8
commit 6dd7054295
1 changed files with 6 additions and 0 deletions

View File

@ -5551,11 +5551,17 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str:
if ' ' not in line: if ' ' not in line:
line = tagsFile.readline() line = tagsFile.readline()
lineCtr += 1 lineCtr += 1
# don't read too many lines
if lineCtr > 4:
break
continue continue
postDaysSinceEpochStr = line.split(' ')[0] postDaysSinceEpochStr = line.split(' ')[0]
if not postDaysSinceEpochStr.isdigit(): if not postDaysSinceEpochStr.isdigit():
line = tagsFile.readline() line = tagsFile.readline()
lineCtr += 1 lineCtr += 1
# don't read too many lines
if lineCtr > 4:
break
continue continue
postDaysSinceEpoch = int(postDaysSinceEpochStr) postDaysSinceEpoch = int(postDaysSinceEpochStr)
if postDaysSinceEpoch < daysSinceEpoch: if postDaysSinceEpoch < daysSinceEpoch: