Skip to content

Commit 7ad251b

Browse files
committed
Log and Continue on OSError while collating dates for date filters
Log to understand if error, date can be handled better Mitigates #172
1 parent 2bed4c3 commit 7ad251b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/khoj/search_filter/date_filter.py

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def load(self, entries, *args, **kwargs):
4141
date_in_entry = datetime.strptime(date_in_entry_string, "%Y-%m-%d").timestamp()
4242
except ValueError:
4343
continue
44+
except OSError:
45+
logger.debug(f"OSError: Ignoring unprocessable date in entry: {date_in_entry_string}")
46+
continue
4447
self.date_to_entry_ids[date_in_entry].add(id)
4548

4649
def can_filter(self, raw_query):

0 commit comments

Comments
 (0)