diff options
author | Max Kellermann <max@duempel.org> | 2013-04-08 22:31:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-04-08 23:11:36 +0200 |
commit | dca111519627813608807b60b98f3d5133880120 (patch) | |
tree | e19e6733975211a71a0b5b646c4a086be03d7bd1 /src/StateFile.hxx | |
parent | 96882175f15230fe2cf9b4e7f3a7f29b5697fe26 (diff) |
StateFile: schedule timer only after a change
Save the state file 2 minutes after the last change. This reduces the
disruptions by an idle MPD, and MPD can be paged out permanently until
it is used.
Diffstat (limited to 'src/StateFile.hxx')
-rw-r--r-- | src/StateFile.hxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/StateFile.hxx b/src/StateFile.hxx index 7d57d5422..79693c70b 100644 --- a/src/StateFile.hxx +++ b/src/StateFile.hxx @@ -48,6 +48,11 @@ public: void Read(); void Write(); + /** + * Schedules a write if MPD's state was modified. + */ + void CheckModified(); + private: /** * Save the current state versions for use with IsModified(). @@ -61,8 +66,6 @@ private: gcc_pure bool IsModified() const; - void AutoWrite(); - /* virtual methods from TimeoutMonitor */ virtual bool OnTimeout() override; }; |