Remove the indexer lock if it's too old (> 5 hours)

tags/0.1.9
Daniel Berteaud 11 years ago
parent 23bbb41220
commit 587ba5234d
  1. 6
      root/etc/cron.daily/ajaxplorer-indexer

@ -24,6 +24,12 @@ foreach my $share ($a->get_all_by_prop(type => 'share')){
$indexer = $share->prop('AjaxplorerIndexer') || 'enabled'; $indexer = $share->prop('AjaxplorerIndexer') || 'enabled';
next if ($ajaxplorer ne 'enabled' || $indexer ne 'enabled'); next if ($ajaxplorer ne 'enabled' || $indexer ne 'enabled');
my $name = $share->key; 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 ' . system('/usr/bin/sudo -u www /usr/bin/php /usr/share/ajaxplorer/cmd.php ' .
'-u=RDiin175M40T0cYvXLARpAi+1TsSVkbksEDZ4KvwBuY= '. '-u=RDiin175M40T0cYvXLARpAi+1TsSVkbksEDZ4KvwBuY= '.
'-t=e71479ebc4365176d9f09fe957780024 -a=index '. '-t=e71479ebc4365176d9f09fe957780024 -a=index '.

Loading…
Cancel
Save