Skip to content

Commit

Permalink
fix(ConfigFileUpdate): no need to create user build if shared build i…
Browse files Browse the repository at this point in the history
…s up-to-date
  • Loading branch information
lotem committed Mar 8, 2018
1 parent 831ffba commit cafd5c4
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/rime/lever/deployment_tasks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,23 @@ static bool ConfigNeedsUpdate(Config* config) {
"config_source_file", "", ".yaml"
}));
for (auto entry : *timestamps.AsMap()) {
fs::path source_file_path = resolver->ResolvePath(entry.first);
if (!fs::exists(source_file_path)) {
LOG(INFO) << "source file no longer exists: " << source_file_path.string();
return true;
}
auto value = As<ConfigValue>(entry.second);
int recorded_time = 0;
if (!value || !value->GetInt(&recorded_time) ||
recorded_time != (int) fs::last_write_time(source_file_path)) {
LOG(INFO) << "source file changed: " << source_file_path.string();
if (!value || !value->GetInt(&recorded_time)) {
LOG(WARNING) << "invalid timestamp for " << entry.first;
return true;
}
fs::path source_file = resolver->ResolvePath(entry.first);
if (!fs::exists(source_file)) {
if (recorded_time) {
LOG(INFO) << "source file no longer exists: " << source_file.string();
return true;
}
continue;
}
if (recorded_time != (int) fs::last_write_time(source_file)) {
LOG(INFO) << "source file " << (recorded_time ? "changed: " : "added: ")
<< source_file.string();
return true;
}
}
Expand Down

0 comments on commit cafd5c4

Please sign in to comment.