Skip to content

Commit

Permalink
Add cache_read paramater to disable cache on meta info.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Johnston committed Apr 15, 2014
1 parent f16543c commit 3846669
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dropboxfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def __init__(self, *args, **kwargs):
# metadata() and children(). This allows for more fine-grained fetches
# and caching.

def metadata(self, path):
def metadata(self, path, cache_read=True):
"Gets metadata for a given path."
item = self.cache.get(path)
item = self.cache.get(path) if cache_read else None
if not item or item.metadata is None or item.expired:
try:
metadata = super(DropboxClient, self).metadata(path,
Expand Down Expand Up @@ -455,9 +455,9 @@ def listdir(self, path="/", wildcard=None, full=False, absolute=False, dirs_only
return self._listdir_helper(path, children, wildcard, full, absolute, dirs_only, files_only)

@synchronize
def getinfo(self, path):
def getinfo(self, path, cache_read=True):
path = abspath(normpath(path))
metadata = self.client.metadata(path)
metadata = self.client.metadata(path, cache_read=cache_read)
return metadata_to_info(metadata, localtime=self.localtime)

def copy(self, src, dst, *args, **kwargs):
Expand Down

0 comments on commit 3846669

Please sign in to comment.