Skip to content

Commit d0d42b6

Browse files
committed
fix(search): Better filelock args
1 parent 4c41ac1 commit d0d42b6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

helpdesk/hooks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
]
2525

2626
scheduler_events = {
27-
"all": ["helpdesk.search.build_index_if_not_exists"],
28-
"hourly": ["helpdesk.search.download_corpus"],
27+
"all": [
28+
"helpdesk.search.build_index_if_not_exists",
29+
"helpdesk.search.download_corpus",
30+
],
2931
"daily": [
3032
"helpdesk.helpdesk.doctype.hd_ticket.hd_ticket.close_tickets_after_n_days"
3133
],

helpdesk/search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def search(query, only_articles=False) -> list[dict[str, list[dict]]]:
379379

380380

381381
@frappe.whitelist()
382-
@filelock("helpdesk_search_indexing", timeout=60)
382+
@filelock("helpdesk_search_indexing", timeout=1)
383383
def build_index():
384384
frappe.cache().set_value("helpdesk_search_indexing_in_progress", True)
385385
search = HelpdeskSearch()
@@ -398,7 +398,7 @@ def build_index_if_not_exists():
398398
build_index()
399399

400400

401-
@filelock("helpdesk_corpus_download", timeout=60)
401+
@filelock("helpdesk_corpus_download", timeout=1, is_global=True)
402402
def download_corpus():
403403
from nltk import data, download
404404

0 commit comments

Comments
 (0)