mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01: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:
parent
2bed4c3b50
commit
7ad251b8ef
1 changed files with 3 additions and 0 deletions
|
@ -41,6 +41,9 @@ class DateFilter(BaseFilter):
|
|||
date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp()
|
||||
except ValueError:
|
||||
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)
|
||||
|
||||
def can_filter(self, raw_query):
|
||||
|
|
Loading…
Reference in a new issue