|
@@ -1320,22 +1320,24 @@ public:
|
|
|
ForEach(h)
|
|
|
{
|
|
|
ILazyFileIO *f = files.mapToValue(&h.query());
|
|
|
- const char *fname = remote ? f->querySource()->queryFilename() : f->queryFilename();
|
|
|
if (f->isAlive() && f->isOpen() && f->isRemote()==remote && !f->isCopying())
|
|
|
{
|
|
|
unsigned age = msTick() - f->getLastAccessed();
|
|
|
if (age > maxFileAge[remote])
|
|
|
{
|
|
|
if (traceLevel > 5)
|
|
|
+ {
|
|
|
+ // NOTE - querySource will cause the file to be opened if not already open
|
|
|
+ // That's OK here, since we know the file is open and remote.
|
|
|
+ // But don't be tempted to move this line outside these if's (eg. to trace the idle case)
|
|
|
+ const char *fname = remote ? f->querySource()->queryFilename() : f->queryFilename();
|
|
|
DBGLOG("Closing inactive %s file %s (last accessed %u ms ago)", remote ? "remote" : "local", fname, age);
|
|
|
+ }
|
|
|
f->close();
|
|
|
}
|
|
|
else
|
|
|
goers.append(*f);
|
|
|
}
|
|
|
- else if (traceLevel > 8)
|
|
|
- DBGLOG("Ignoring idle %s file %s", remote ? "remote" : "local", fname);
|
|
|
-
|
|
|
}
|
|
|
unsigned numFilesLeft = goers.ordinality();
|
|
|
if (numFilesLeft > maxFilesOpen[remote])
|