Don't replace cached file_id of being uploaded files.
This commit is contained in:
parent
59d4248efb
commit
3373ac8aa8
@ -3270,6 +3270,7 @@ Result<FileId> FileManager::get_input_file_id(FileType type, const tl_object_ptr
|
|||||||
if (r_file_content.is_ok()) {
|
if (r_file_content.is_ok()) {
|
||||||
hash = sha256(r_file_content.ok());
|
hash = sha256(r_file_content.ok());
|
||||||
auto file_id = file_hash_to_file_id_.get(hash);
|
auto file_id = file_hash_to_file_id_.get(hash);
|
||||||
|
LOG(INFO) << "Found file " << file_id << " by hash " << hex_encode(hash);
|
||||||
if (file_id.is_valid()) {
|
if (file_id.is_valid()) {
|
||||||
auto file_view = get_file_view(file_id);
|
auto file_view = get_file_view(file_id);
|
||||||
if (!file_view.empty()) {
|
if (!file_view.empty()) {
|
||||||
@ -3279,6 +3280,9 @@ Result<FileId> FileManager::get_input_file_id(FileType type, const tl_object_ptr
|
|||||||
if (file_view.has_remote_location() && !file_view.remote_location().is_web()) {
|
if (file_view.has_remote_location() && !file_view.remote_location().is_web()) {
|
||||||
return file_id;
|
return file_id;
|
||||||
}
|
}
|
||||||
|
if (file_view.is_uploading()) {
|
||||||
|
hash.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user