diff --git a/root/etc/cron.daily/ajaxplorer-indexer b/root/etc/cron.daily/ajaxplorer-indexer index b9af107..5fa8306 100644 --- a/root/etc/cron.daily/ajaxplorer-indexer +++ b/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'; 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 '.