Skip to content

Commit

Permalink
Skip searching update time of non-existing files.
Browse files Browse the repository at this point in the history
  • Loading branch information
kichunya committed Jan 18, 2023
1 parent 934bac4 commit 334f423
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server/src/Synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ bool Synchronizer::isProbablyOutdatedStubs(const fs::path &srcFilePath) const {
} catch (...) {
return true;
}
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
if (!fs::exists(srcFilePath)){
srcTimestamp = time(NULL);
}
else {
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
}
return stubTimestamp <= srcTimestamp;
}

Expand All @@ -75,7 +80,12 @@ bool Synchronizer::isProbablyOutdatedWrappers(const fs::path &srcFilePath) const
}
long long wrapperTimestamp, srcTimestamp;
wrapperTimestamp = Synchronizer::getFileOutdatedTime(wrapperFilePath);
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
if (!fs::exists(srcFilePath)){
srcTimestamp = time(NULL);
}
else {
srcTimestamp = Synchronizer::getFileOutdatedTime(srcFilePath);
}
return wrapperTimestamp <= srcTimestamp;
}

Expand Down

0 comments on commit 334f423

Please sign in to comment.