-
Notifications
You must be signed in to change notification settings - Fork 12
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
optimistic get_path() #27
Comments
Actually, it seems that |
This leads to some implementation details leaking out of the API: file_path = file_id_manager.get_path(file_id)
if file_path is None:
# the file may have been moved, sync and try again
file_id_manager.sync_all()
file_path = file_id_manager.get_path(file_id) In the end, we just want the path corresponding to an ID, no matter what it takes to get it, so I think we shouldn't have to manually call |
Agreed. Since optimistic |
@kevin-bates @davidbrochart I've thought about this a lot today. I think an optimistic
In summary, optimistic
I think this is definitely the direction we want to take with the |
Problem
get_path()
callssync_all()
even when the file wasn't moved.Proposed Solution
Implement an optimistic strategy that looks up the existing path record in the DB. Then check if the file currently is still present at the same path, with the same inode number and timestamps. If so, then return the path early without calling
sync_all()
.The text was updated successfully, but these errors were encountered: