Skip to content

Commit 7f65250

Browse files
committed
improved file format, increasing I/O performance by storing hashes instead of html strings
1 parent e8326d9 commit 7f65250

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mwc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,19 @@ def pollWebsites():
295295
else:
296296
# otherwise, check which parts of the site were updated
297297
changes = 0
298-
fileContents = getStoredHashes(site['shortname'])
298+
fileHashes = getStoredHashes(site['shortname'])
299299
i = 0
300300
for content in parseResult['contents']:
301301

302302
contenthash = hashlib.md5(content.encode(defaultEncoding)).hexdigest()
303-
if contenthash not in fileContents:
303+
if contenthash not in fileHashes:
304304
if config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
305305
changes += 1
306306
sessionHashes.append(contenthash)
307307

308308
subject = '[' + site['shortname'] + '] ' + parseResult['titles'][i]
309309
print(' ' + subject)
310-
if config.enableMailNotifications and len(fileContents) > 0:
310+
if config.enableMailNotifications and len(fileHashes) > 0:
311311
sendmail(receiver, subject, content, (site.get('type', 'html') == 'html'), site['uri'])
312312
mailsSent = mailsSent + 1
313313

0 commit comments

Comments
 (0)