1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 20:15:22 +02:00

[291738] [efs] repeated queries to RSEFileStoreImpl.fetchInfo() in short time-span should be reduced

This commit is contained in:
David McKnight 2009-11-05 19:26:57 +00:00
parent 87fe6cba8e
commit 6061e69e55

View file

@ -518,7 +518,7 @@ public class RSEFileStoreImpl extends FileStore
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException { public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException {
long curTime = System.currentTimeMillis(); long curTime = System.currentTimeMillis();
// don't clear cache when there are several successive queries in a short time-span // don't clear cache when there are several successive queries in a short time-span
if (_lastFetch == 0 || ((curTime - _lastFetch) > 1000)){ if (_lastFetch == 0 || ((curTime - _lastFetch) > 5000)){
// clear cache in order to query latest info // clear cache in order to query latest info
cacheRemoteFile(null); cacheRemoteFile(null);
_lastFetch = curTime; _lastFetch = curTime;
@ -648,6 +648,7 @@ public class RSEFileStoreImpl extends FileStore
if (remoteFile.isFile()) { if (remoteFile.isFile()) {
try { try {
cacheRemoteFile(null);
return subSys.getInputStream(remoteFile.getParentPath(), remoteFile.getName(), true, monitor); return subSys.getInputStream(remoteFile.getParentPath(), remoteFile.getName(), true, monitor);
} }
catch (SystemMessageException e) { catch (SystemMessageException e) {
@ -742,6 +743,7 @@ public class RSEFileStoreImpl extends FileStore
} else { } else {
options = IFileService.NONE; options = IFileService.NONE;
} }
cacheRemoteFile(null);
return subSys.getOutputStream(remoteFile.getParentPath(), remoteFile.getName(), options, monitor); return subSys.getOutputStream(remoteFile.getParentPath(), remoteFile.getName(), options, monitor);
} }
catch (SystemMessageException e) { catch (SystemMessageException e) {