event/Loop: use std::chrono
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user