aboutsummaryrefslogtreecommitdiffstats
path: root/src/StateFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-24 12:59:45 +0200
committerMax Kellermann <max@duempel.org>2014-08-24 13:24:20 +0200
commit42af040fbd0cd2b9942f02ace3462ee8ac41d3ac (patch)
tree77501fc829969fe8bf07739329ca5431fbdded29 /src/StateFile.cxx
parentd383d617c2d16bda9f32fe31e0171a59f4601f89 (diff)
downloadmpd-42af040fbd0cd2b9942f02ace3462ee8ac41d3ac.tar.gz
mpd-42af040fbd0cd2b9942f02ace3462ee8ac41d3ac.tar.xz
mpd-42af040fbd0cd2b9942f02ace3462ee8ac41d3ac.zip
StateFile: configurable interval
Diffstat (limited to '')
-rw-r--r--src/StateFile.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/StateFile.cxx b/src/StateFile.cxx
index e0f0cedb1..7e9e35cc3 100644
--- a/src/StateFile.cxx
+++ b/src/StateFile.cxx
@@ -36,10 +36,11 @@
static constexpr Domain state_file_domain("state_file");
-StateFile::StateFile(AllocatedPath &&_path,
+StateFile::StateFile(AllocatedPath &&_path, unsigned _interval,
Partition &_partition, EventLoop &_loop)
:TimeoutMonitor(_loop),
path(std::move(_path)), path_utf8(path.ToUTF8()),
+ interval(_interval),
partition(_partition),
prev_volume_version(0), prev_output_version(0),
prev_playlist_version(0)
@@ -137,7 +138,7 @@ void
StateFile::CheckModified()
{
if (!IsActive() && IsModified())
- ScheduleSeconds(2 * 60);
+ ScheduleSeconds(interval);
}
void