Kaynağa Gözat

Merge pull request #11502 from ghalliday/issue20184

HPCC-20184 Ensure that old cache entries are overwritten

Reviewed-By: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 yıl önce
ebeveyn
işleme
288e2b525a
2 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 1 1
      ecl/hql/hqlexpr.cpp
  2. 1 1
      system/jlib/jfile.cpp

+ 1 - 1
ecl/hql/hqlexpr.cpp

@@ -1127,7 +1127,7 @@ bool HqlParseContext::createCache(IHqlExpression * simplifiedDefinition, bool is
         writeStringToStream(*stream, "</Cache>\n");
         writeStringToStream(*stream, "</Cache>\n");
         stream->flush();
         stream->flush();
     }
     }
-    cacheFile->rename(filename);
+    cacheFile->move(filename);
     return true;
     return true;
 }
 }
 
 

+ 1 - 1
system/jlib/jfile.cpp

@@ -779,7 +779,7 @@ void CFile::move(const char *newname)
 #ifdef _WIN32
 #ifdef _WIN32
     unsigned retry = 0;
     unsigned retry = 0;
     for (;;) {
     for (;;) {
-        if (MoveFileEx(filename.get(),newname,0)) 
+        if (MoveFileEx(filename.get(),newname, MOVEFILE_REPLACE_EXISTING))
             return;
             return;
         DWORD err = GetLastError();
         DWORD err = GetLastError();
         if ((retry++==10)||  // some or all of the following can occur when the domain controller gets busy
         if ((retry++==10)||  // some or all of the following can occur when the domain controller gets busy