Skip to content

Commit

Permalink
Fix potential bug where a url could be added multiple times from email.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTyton committed Sep 24, 2024
1 parent 3abb7dd commit 9b0bc9d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion release-versions/calibre.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.13.0
7.18.0
2 changes: 1 addition & 1 deletion release-versions/fff.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.36.2
4.38.0
2 changes: 1 addition & 1 deletion release-versions/latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.07.27-1
2024.09.24
5 changes: 4 additions & 1 deletion root/app/url_ingester.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def email_watcher(
while True:
# Get URLs from the email account
urls = email_info.get_urls()
fics_to_add = set()
for url in urls:
fanfic = regex_parsing.generate_FanficInfo_from_url(url)
ff_logging.log(
Expand All @@ -150,6 +151,8 @@ def email_watcher(
"New Fanfiction Download", fanfic.url, fanfic.site
)
continue
processor_queues[fanfic.site].put(fanfic)
fics_to_add.add(fanfic)
for fic in fics_to_add:
processor_queues[fic.site].put(fic)
# Wait before checking the email account again
time.sleep(email_info.sleep_time)

0 comments on commit 9b0bc9d

Please sign in to comment.