Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: File ID Manager base implementation #921

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
prefer _stat() over DirEntry.stat() for windows support
dlqqq committed Aug 1, 2022
commit 7ff6cb970c1f0e1b0ff76317db4d7adfbad85041
4 changes: 2 additions & 2 deletions jupyter_server/services/contents/fileidmanager.py
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ def _index_dir_recursively(self, dir_path, stat_info):
with os.scandir(dir_path) as scan_iter:
for entry in scan_iter:
if entry.is_dir():
self._index_dir_recursively(entry.path, self._parse_raw_stat(entry.stat()))
self._index_dir_recursively(entry.path, self._stat(entry.path))
scan_iter.close()

def _sync_all(self):
@@ -134,7 +134,7 @@ def _sync_dir(self, dir_path):
"""
with os.scandir(dir_path) as scan_iter:
for entry in scan_iter:
stat_info = self._parse_raw_stat(entry.stat())
stat_info = self._stat(entry.path)
id, is_dirty_dir = self._sync_file(entry.path, stat_info)

# if entry is unindexed directory, create new record