tdesktop/Telegram/SourceFiles/storage/storage_clear_legacy.h
John Preston 9ba331693f Async clear of legacy local storage.
Sync call to QDir::entryList is a bad idea for the user data folder.
Some users reported hanging on startup with 1.25M legacy cache files.
Now we enumerate up to 10000 files at once asynchronously and clear.
2018-09-04 22:37:22 +03:00

27 lines
648 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Storage {
using CollectGoodFiles = Fn<void(FnMut<void(base::flat_set<QString>&&)>)>;
void ClearLegacyFiles(const QString &base, CollectGoodFiles filter);
namespace details {
std::vector<QString> CollectFiles(
const QString &base,
size_type limit,
const base::flat_set<QString> &skip);
bool RemoveLegacyFile(const QString &path);
} // namespace details
} // namespace Storage