diff options
author | Max Kellermann <max@musicpd.org> | 2016-12-27 23:06:34 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-12-28 01:15:08 +0100 |
commit | b042095ac239be78a704293f217328b7f1b4cc16 (patch) | |
tree | fcf5cc24aa212066562cef91dc24df2c89fd402f /src/db/update | |
parent | 3413d1bf23a7ba4f33d015d1ec5024c191fe08e5 (diff) |
event/Loop: use std::chrono
Diffstat (limited to 'src/db/update')
-rw-r--r-- | src/db/update/InotifyQueue.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/db/update/InotifyQueue.cxx b/src/db/update/InotifyQueue.cxx index 2ce77fcec..8ed492b4c 100644 --- a/src/db/update/InotifyQueue.cxx +++ b/src/db/update/InotifyQueue.cxx @@ -29,7 +29,8 @@ * update_enqueue(). This increases the probability that updates can * be bundled. */ -static constexpr unsigned INOTIFY_UPDATE_DELAY_S = 5; +static constexpr std::chrono::steady_clock::duration INOTIFY_UPDATE_DELAY = + std::chrono::seconds(5); void InotifyQueue::OnTimeout() @@ -42,7 +43,7 @@ InotifyQueue::OnTimeout() id = update.Enqueue(uri_utf8, false); if (id == 0) { /* retry later */ - ScheduleSeconds(INOTIFY_UPDATE_DELAY_S); + Schedule(INOTIFY_UPDATE_DELAY); return; } @@ -68,7 +69,7 @@ path_in(const char *path, const char *possible_parent) void InotifyQueue::Enqueue(const char *uri_utf8) { - ScheduleSeconds(INOTIFY_UPDATE_DELAY_S); + Schedule(INOTIFY_UPDATE_DELAY); for (auto i = queue.begin(), end = queue.end(); i != end;) { const char *current_uri = i->c_str(); |