|
a/src/index/rclmonprc.cpp |
|
b/src/index/rclmonprc.cpp |
|
... |
|
... |
462 |
LOGDEB("start_monitoring: entering main loop\n" );
|
462 |
LOGDEB("start_monitoring: entering main loop\n" );
|
463 |
|
463 |
|
464 |
bool timedout;
|
464 |
bool timedout;
|
465 |
time_t lastauxtime = time(0);
|
465 |
time_t lastauxtime = time(0);
|
466 |
time_t lastixtime = lastauxtime;
|
466 |
time_t lastixtime = lastauxtime;
|
|
|
467 |
time_t lastmovetime = 0;
|
467 |
bool didsomething = false;
|
468 |
bool didsomething = false;
|
468 |
list<string> modified;
|
469 |
list<string> modified;
|
469 |
list<string> deleted;
|
470 |
list<string> deleted;
|
470 |
|
471 |
|
471 |
;
|
|
|
472 |
|
|
|
473 |
// Set a relatively short timeout for better monitoring of exit requests
|
|
|
474 |
while (true) {
|
472 |
while (true) {
|
|
|
473 |
time_t now = time(0);
|
|
|
474 |
if (now - lastmovetime > ixinterval) {
|
|
|
475 |
lastmovetime = now;
|
|
|
476 |
runWebFilesMoverScript(conf);
|
|
|
477 |
}
|
|
|
478 |
|
475 |
{
|
479 |
{
|
|
|
480 |
// Wait for event or timeout.
|
|
|
481 |
// Set a relatively short timeout for better monitoring of
|
|
|
482 |
// exit requests.
|
476 |
std::unique_lock<std::mutex> lock = rclEQ.wait(2, &timedout);
|
483 |
std::unique_lock<std::mutex> lock = rclEQ.wait(2, &timedout);
|
477 |
|
484 |
|
478 |
// x11IsAlive() can't be called from ok() because both
|
485 |
// x11IsAlive() can't be called from ok() because both
|
479 |
// threads call it and Xlib is not multithreaded.
|
486 |
// threads call it and Xlib is not multithreaded.
|
480 |
#ifndef _WIN32
|
487 |
#ifndef _WIN32
|
|
... |
|
... |
523 |
LOGDEB("Monitor: got Other on [" << (ev.m_path) << "]\n" );
|
530 |
LOGDEB("Monitor: got Other on [" << (ev.m_path) << "]\n" );
|
524 |
}
|
531 |
}
|
525 |
}
|
532 |
}
|
526 |
}
|
533 |
}
|
527 |
|
534 |
|
|
|
535 |
now = time(0);
|
528 |
// Process. We don't do this every time but let the lists accumulate
|
536 |
// Process. We don't do this every time but let the lists accumulate
|
529 |
// a little, this saves processing. Start at once if list is big.
|
537 |
// a little, this saves processing. Start at once if list is big.
|
530 |
time_t now = time(0);
|
|
|
531 |
if (expeditedIndexingRequested(conf) ||
|
538 |
if (expeditedIndexingRequested(conf) ||
|
532 |
(now - lastixtime > ixinterval) ||
|
539 |
(now - lastixtime > ixinterval) ||
|
533 |
(deleted.size() + modified.size() > 20)) {
|
540 |
(deleted.size() + modified.size() > 20)) {
|
534 |
lastixtime = now;
|
541 |
lastixtime = now;
|
535 |
// Used to do the modified list first, but it does seem
|
542 |
// Used to do the modified list first, but it does seem
|
|
... |
|
... |
551 |
didsomething = true;
|
558 |
didsomething = true;
|
552 |
}
|
559 |
}
|
553 |
}
|
560 |
}
|
554 |
|
561 |
|
555 |
// Recreate the auxiliary dbs every hour at most.
|
562 |
// Recreate the auxiliary dbs every hour at most.
|
|
|
563 |
now = time(0);
|
556 |
if (didsomething && time(0) - lastauxtime > auxinterval) {
|
564 |
if (didsomething && now - lastauxtime > auxinterval) {
|
557 |
lastauxtime = time(0);
|
565 |
lastauxtime = now;
|
558 |
didsomething = false;
|
566 |
didsomething = false;
|
559 |
if (!createAuxDbs(conf)) {
|
567 |
if (!createAuxDbs(conf)) {
|
560 |
// We used to bail out on error here. Not anymore,
|
568 |
// We used to bail out on error here. Not anymore,
|
561 |
// because this is most of the time due to a failure
|
569 |
// because this is most of the time due to a failure
|
562 |
// of aspell dictionary generation, which is not
|
570 |
// of aspell dictionary generation, which is not
|