Skip to content

Commit 334f423

Browse files
committed
Skip searching update time of non-existing files.
1 parent 934bac4 commit 334f423

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

server/src/Synchronizer.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ bool Synchronizer::isProbablyOutdatedStubs(const fs::path &srcFilePath) const {
6464
} catch (...) {
6565
return true;
6666
}
67-
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
67+
if (!fs::exists(srcFilePath)){
68+
srcTimestamp = time(NULL);
69+
}
70+
else {
71+
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
72+
}
6873
return stubTimestamp <= srcTimestamp;
6974
}
7075

@@ -75,7 +80,12 @@ bool Synchronizer::isProbablyOutdatedWrappers(const fs::path &srcFilePath) const
7580
}
7681
long long wrapperTimestamp, srcTimestamp;
7782
wrapperTimestamp = Synchronizer::getFileOutdatedTime(wrapperFilePath);
78-
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
83+
if (!fs::exists(srcFilePath)){
84+
srcTimestamp = time(NULL);
85+
}
86+
else {
87+
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
88+
}
7989
return wrapperTimestamp <= srcTimestamp;
8090
}
8191

0 commit comments

Comments
 (0)