mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Log and Continue on OSError while collating dates for date filters
Log to understand if error, date can be handled better Mitigates #172
This commit is contained in:
@@ -41,6 +41,9 @@ class DateFilter(BaseFilter):
|
|||||||
date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp()
|
date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
except OSError:
|
||||||
|
logger.debug(f"OSError: Ignoring unprocessable date in entry: {date_in_entry_string}")
|
||||||
|
continue
|
||||||
self.date_to_entry_ids[date_in_entry].add(id)
|
self.date_to_entry_ids[date_in_entry].add(id)
|
||||||
|
|
||||||
def can_filter(self, raw_query):
|
def can_filter(self, raw_query):
|
||||||
|
|||||||
Reference in New Issue
Block a user