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.
This commit is contained in:
Max Kellermann
2013-04-08 22:31:51 +02:00
parent 96882175f1
commit dca1115196
4 changed files with 15 additions and 18 deletions

View File

@@ -347,6 +347,9 @@ idle_event_emitted(void)
unsigned flags = idle_get();
if (flags != 0)
client_list->IdleAdd(flags);
if (flags & (IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT))
state_file->CheckModified();
}
/**