Skip to content

Commit

Permalink
fix(monitor): feed migrated even if error occurred
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Nov 5, 2023
1 parent 8d47326 commit 157aa49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/command/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,13 @@ async def __monitor(feed: db.Feed) -> str:
if feed.next_check_time:
feed.next_check_time = None
feed_updated_fields.add('next_check_time')
if wf.url != feed.link:
new_url_feed = await inner.sub.migrate_to_new_url(feed, wf.url)
feed = new_url_feed if isinstance(new_url_feed, db.Feed) else feed

if feed_updated_fields:
await feed.save(update_fields=feed_updated_fields)

if wf.url != feed.link:
new_url_feed = await inner.sub.migrate_to_new_url(feed, wf.url)
feed = new_url_feed if isinstance(new_url_feed, db.Feed) else feed

await asyncio.gather(*(__notify_all(feed, subs, entry) for entry in reversed(updated_entries)))

return UPDATED
Expand Down

0 comments on commit 157aa49

Please sign in to comment.