Retain failed download destinations for later cleanup
This commit is contained in:
1 parent
41057ee9d5
commit
d4efdba44e
2 files changed
+3
-1
No files matched your search
+1
-1
@@ -1596,7 +1596,7 @@ static void cache_file_collect_cb(const struct media_msg_file* f, void* arg) {
|
||||
/* Фактическая сумма размеров файлов, соответствующих сообщениям. */
|
||||
static uint64_t chat_media_cache_scan_sum(struct chat_core_ctx* cc) {
|
||||
char media_base[MEDIA_BASE_MAX];
|
||||
if (media_index_get_base(cc->db, media_base)) return;
|
||||
if (media_index_get_base(cc->db, media_base)) return cc->media_cache_bytes;
|
||||
struct cache_file_list files = {0};
|
||||
chat_media_foreach_media_message(cc, media_base, cache_file_collect_cb, &files);
|
||||
uint64_t sum = 0;
|
||||
|
||||
@@ -880,6 +880,8 @@ int media_download_start(struct UTUN_INSTANCE* inst, uint64_t group_id,
|
||||
DEBUG_WARN(DEBUG_CATEGORY_GENERAL, "%s: DUPLICATE download media=%02x%02x... ignored", MDL_ID, result->media_id[0], result->media_id[1]);
|
||||
return 0;
|
||||
}
|
||||
char channel[32]; snprintf(channel, sizeof(channel), "%llu", (unsigned long long)group_id);
|
||||
if (media_index_track_preparation(inst->topo_sqlite_db, channel, dest_path, media_base)) return -1;
|
||||
|
||||
struct media_download* dl = u_calloc(1, sizeof(*dl));
|
||||
if (!dl) { DEBUG_ERROR(DEBUG_CATEGORY_GENERAL, "%s: u_calloc for download failed", MDL_ID); return -1; }
|
||||
|
||||
Reference in new issue
Block a user