monitor: perform doc deletes before updates. Start processing the queue as soon as it s big enough even if interval not expired
This commit is contained in:
parent
b2872935bb
commit
5d0a22f5c3
@ -497,19 +497,14 @@ bool startMonitor(RclConfig *conf, int opts)
|
|||||||
// Unlock queue before processing lists
|
// Unlock queue before processing lists
|
||||||
rclEQ.unlock();
|
rclEQ.unlock();
|
||||||
|
|
||||||
// Process. We don't do this everytime but let the lists accumulate
|
// Process. We don't do this every time but let the lists accumulate
|
||||||
// a little, this saves processing.
|
// a little, this saves processing. Start at once if list is big.
|
||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
if (now - lastixtime > ixinterval) {
|
if ((now - lastixtime > ixinterval) ||
|
||||||
|
(deleted.size() + modified.size() > 20)) {
|
||||||
lastixtime = now;
|
lastixtime = now;
|
||||||
if (!modified.empty()) {
|
// Used to do the modified list first, but it does seem
|
||||||
modified.sort();
|
// smarter to make room first...
|
||||||
modified.unique();
|
|
||||||
if (!indexfiles(conf, modified))
|
|
||||||
break;
|
|
||||||
modified.clear();
|
|
||||||
didsomething = true;
|
|
||||||
}
|
|
||||||
if (!deleted.empty()) {
|
if (!deleted.empty()) {
|
||||||
deleted.sort();
|
deleted.sort();
|
||||||
deleted.unique();
|
deleted.unique();
|
||||||
@ -518,6 +513,14 @@ bool startMonitor(RclConfig *conf, int opts)
|
|||||||
deleted.clear();
|
deleted.clear();
|
||||||
didsomething = true;
|
didsomething = true;
|
||||||
}
|
}
|
||||||
|
if (!modified.empty()) {
|
||||||
|
modified.sort();
|
||||||
|
modified.unique();
|
||||||
|
if (!indexfiles(conf, modified))
|
||||||
|
break;
|
||||||
|
modified.clear();
|
||||||
|
didsomething = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recreate the auxiliary dbs every hour at most.
|
// Recreate the auxiliary dbs every hour at most.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user