Add debug logs for recent/top peers resetting.

This commit is contained in:
John Preston
2024-10-04 10:06:14 +04:00
parent a74c5a89a6
commit df2b020b42
3 changed files with 28 additions and 0 deletions

View File

@@ -2956,11 +2956,13 @@ void Account::readSearchSuggestions() {
}
_searchSuggestionsRead = true;
if (!_searchSuggestionsKey) {
DEBUG_LOG(("Suggestions: No key."));
return;
}
FileReadDescriptor suggestions;
if (!ReadEncryptedFile(suggestions, _searchSuggestionsKey, _basePath, _localKey)) {
DEBUG_LOG(("Suggestions: Could not read file."));
ClearKey(_searchSuggestionsKey, _basePath);
_searchSuggestionsKey = 0;
writeMapDelayed();
@@ -2973,6 +2975,8 @@ void Account::readSearchSuggestions() {
if (CheckStreamStatus(suggestions.stream)) {
_owner->session().topPeers().applyLocal(top);
_owner->session().recentPeers().applyLocal(recent);
} else {
DEBUG_LOG(("Suggestions: Could not read content."));
}
}