perf: Enqueue "removing of index" on web page save (#22409)

* perf: Enqueue "removing of index" on web page save

* fix: Enqueue after commit

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

* fix: enqueue after commit

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
Suraj Shetty 2023-09-14 14:58:19 +05:30 committed by GitHub
parent 909457de3d
commit 2587d3e2e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,7 +174,7 @@ class WebsiteGenerator(Document):
return
if self.is_website_published():
frappe.enqueue(update_index_for_path, path=self.route)
frappe.enqueue(update_index_for_path, path=self.route, enqueue_after_commit=True)
elif self.route:
# If the website is not published
remove_document_from_index(self.route)
frappe.enqueue(remove_document_from_index, path=self.route, enqueue_after_commit=True)