From a80e0621e4841f833bb770510d93347fdd6e7f7f Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Tue, 6 Nov 2018 19:02:19 +0300 Subject: [PATCH] FileManager: FILE_GENERATE_LOCATION_INVALID GitOrigin-RevId: bc66c7e63376a3aca0bdcaf1d7f8cbb57e32eb53 --- td/telegram/files/FileGenerateManager.cpp | 2 +- td/telegram/files/FileManager.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/td/telegram/files/FileGenerateManager.cpp b/td/telegram/files/FileGenerateManager.cpp index 476e523a5..a03f3cc1b 100644 --- a/td/telegram/files/FileGenerateManager.cpp +++ b/td/telegram/files/FileGenerateManager.cpp @@ -367,7 +367,7 @@ static Status check_mtime(std::string &conversion, CSlice original_path) { if (expected_mtime == actual_mtime) { return Status::OK(); } - return Status::Error(PSLICE() << "File \"" << original_path + return Status::Error(PSLICE() << "FILE_GENERATE_LOCATION_INVALID: File \"" << original_path << "\" was modified: " << tag("expected modification time", expected_mtime) << tag("actual modification time", actual_mtime)); } diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 4ec68d6a0..486b45796 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -2465,6 +2465,10 @@ void FileManager::on_error_impl(FileNodePtr node, FileManager::Query::Type type, } } + if (begins_with(status.message(), "FILE_GENERATE_LOCATION_INVALID")) { + node->set_generate_location(nullptr); + } + if (status.message() == "FILE_UPLOAD_RESTART") { run_upload(node, {}); return;