Skip to content
Snippets Groups Projects
Commit 26497271 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

correctly wait for a lock in indexer (related to FS#2112)

parent 7cb9f9ee
No related branches found
No related tags found
No related merge requests found
......@@ -149,6 +149,7 @@ function runIndexer(){
}
// try to aquire a lock
$run = 0;
$lock = $conf['lockdir'].'/_indexer.lock';
while(!@mkdir($lock,$conf['dmode'])){
usleep(50);
......@@ -156,7 +157,8 @@ function runIndexer(){
// looks like a stale lock - remove it
@rmdir($lock);
print "runIndexer(): stale lock removed".NL;
}else{
}elseif($run++ = 1000){
// we waited 5 seconds for that lock
print "runIndexer(): indexer locked".NL;
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment