Remove the indexer lock if it's too old (> 5 hours)
This commit is contained in:
parent
23bbb41220
commit
587ba5234d
|
@ -24,6 +24,12 @@ foreach my $share ($a->get_all_by_prop(type => 'share')){
|
|||
$indexer = $share->prop('AjaxplorerIndexer') || 'enabled';
|
||||
next if ($ajaxplorer ne 'enabled' || $indexer ne 'enabled');
|
||||
my $name = $share->key;
|
||||
# Check if the lock file is present and if it's too old (last index crashed ?)
|
||||
if (-e "/var/cache/ajaxplorer/indexes/.ajxp_lock-$name"){
|
||||
my $mtime = stat("/var/cache/ajaxplorer/indexes/.ajxp_lock-$name")->mtime;
|
||||
unlink <"/var/cache/ajaxplorer/indexes/.ajxp_lock-$name">
|
||||
if (time() - $mtime > 18000);
|
||||
}
|
||||
system('/usr/bin/sudo -u www /usr/bin/php /usr/share/ajaxplorer/cmd.php ' .
|
||||
'-u=RDiin175M40T0cYvXLARpAi+1TsSVkbksEDZ4KvwBuY= '.
|
||||
'-t=e71479ebc4365176d9f09fe957780024 -a=index '.
|
||||
|
|
Loading…
Reference in New Issue