feat: add cache cleaner
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include <seallib/log.h>
|
||||
|
||||
class CacheCleaner
|
||||
{
|
||||
public:
|
||||
CacheCleaner();
|
||||
~CacheCleaner();
|
||||
|
||||
void init();
|
||||
void shutdown();
|
||||
|
||||
private:
|
||||
std::string getLocalAppDataPath();
|
||||
void clearFolder(std::string& path);
|
||||
void monitorLoop();
|
||||
|
||||
std::atomic<bool> _running;
|
||||
std::unique_ptr<std::thread> _monitorThread;
|
||||
std::string _cacheDir;
|
||||
|
||||
seallib::Logger* _log;
|
||||
};
|
||||
Reference in New Issue
Block a user