Skip to content

Commit 69fe581

Browse files
[WEB-5228] chore: IssueLink.DoesNotExist on crawl_work_item_link_title (#8003)
* chore: wrap IssueLink logic in a try-except block * chore: user logger.warning * fix: add id and url on the error message
1 parent e09d986 commit 69fe581

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/api/plane/bgtasks/work_item_link_task.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ def fetch_and_encode_favicon(
171171
@shared_task
172172
def crawl_work_item_link_title(id: str, url: str) -> None:
173173
meta_data = crawl_work_item_link_title_and_favicon(url)
174-
issue_link = IssueLink.objects.get(id=id)
175174

176-
issue_link.metadata = meta_data
175+
try:
176+
issue_link = IssueLink.objects.get(id=id)
177+
except IssueLink.DoesNotExist:
178+
logger.warning(f"IssueLink not found for the id {id} and the url {url}")
179+
return
177180

181+
issue_link.metadata = meta_data
178182
issue_link.save()

0 commit comments

Comments
 (0)