mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Added more debug information
This commit is contained in:
parent
f09862c277
commit
ecaa2496dd
|
@ -77,6 +77,7 @@ def fetch_discussions():
|
|||
for post in request_json:
|
||||
if int(post["id"]) > storage["discussion_id"]:
|
||||
try:
|
||||
discussion_logger.debug(f"Sending discussion post with ID {post['id']}")
|
||||
parse_discussion_post(post, comment_pages)
|
||||
except ArticleCommentError:
|
||||
return None
|
||||
|
|
|
@ -47,6 +47,7 @@ class DataFile:
|
|||
"""Data class which instance of is shared by multiple modules to remain consistent and do not cause too many IO operations."""
|
||||
def __init__(self):
|
||||
self.data = self.load_datafile()
|
||||
misc_logger.debug("Current contents of data.json {}".format(self.data))
|
||||
self.changed = False
|
||||
|
||||
@staticmethod
|
||||
|
@ -79,6 +80,7 @@ class DataFile:
|
|||
with open("data.json", "w") as data_file:
|
||||
data_file.write(json.dumps(self.data, indent=4))
|
||||
self.changed = False
|
||||
misc_logger.debug("Saving the database succeeded.")
|
||||
except PermissionError:
|
||||
misc_logger.critical("Could not modify a data file (no permissions). No way to store last edit.")
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in a new issue