Skip to content

Commit

Permalink
Fixup: construct a RecipeURL object in order to access 'find_earliest…
Browse files Browse the repository at this point in the history
…_crawl' attribute

Follows-on-from commit d1e0901.
  • Loading branch information
jayaddison committed Dec 11, 2023
1 parent d1e0901 commit b2e0ef3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reciperadar/workers/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ def crawl_recipe(url):
print(f"Failed to find latest crawl for url={url}")
return

latest_recipe_url = db.session.get(RecipeURL, latest_crawl.url) or RecipeURL(
url=latest_crawl.url
)

# Find the first-known crawl for the latest URL, and consider it the origin
earliest_crawl = latest_crawl.find_earliest_crawl()
earliest_crawl = latest_recipe_url.find_earliest_crawl()
if not earliest_crawl:
print(f"Failed to find earliest crawl for url={url}")
return
Expand Down

0 comments on commit b2e0ef3

Please sign in to comment.