StateFile: configurable interval

This commit is contained in:
Max Kellermann
2014-08-24 12:59:45 +02:00
parent d383d617c2
commit 42af040fbd
6 changed files with 27 additions and 4 deletions

View File

@@ -34,6 +34,8 @@ class StateFile final : private TimeoutMonitor {
const AllocatedPath path;
const std::string path_utf8;
const unsigned interval;
Partition &partition;
/**
@@ -44,7 +46,10 @@ class StateFile final : private TimeoutMonitor {
prev_playlist_version;
public:
StateFile(AllocatedPath &&path, Partition &partition, EventLoop &loop);
static constexpr unsigned DEFAULT_INTERVAL = 2 * 60;
StateFile(AllocatedPath &&path, unsigned interval,
Partition &partition, EventLoop &loop);
void Read();
void Write();