Tidy up return logic

This commit is contained in:
Leigh Morresi
2021-02-21 20:23:50 +01:00
parent 98623de38c
commit 96221598e7
2 changed files with 5 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ class perform_site_check():
def run(self, uuid):
timestamp = int(time.time()) # used for storage etc too
stripped_text_from_html = False
changed_detected = False
update_obj = {'previous_md5': self.datastore.data['watching'][uuid]['previous_md5'],
'history': {},
@@ -79,6 +80,7 @@ class perform_site_check():
# could be None or False depending on JSON type
if self.datastore.data['watching'][uuid]['previous_md5'] != fetched_md5:
changed_detected = True
# Don't confuse people by updating as last-changed, when it actually just changed from None..
if self.datastore.get_val(uuid, 'previous_md5'):
@@ -86,4 +88,4 @@ class perform_site_check():
update_obj["previous_md5"] = fetched_md5
return update_obj, stripped_text_from_html
return changed_detected, update_obj, stripped_text_from_html