Allow to glabally disable indexer, but enable it on specific shares

tags/0.2.4_el5
Daniel Berteaud 11 years ago
parent ffe07b3768
commit cb6175891b
  1. 8
      root/etc/cron.daily/pydio-indexer

@ -10,9 +10,9 @@ my $a = esmith::AccountsDB->open_ro || die "Couldn't open AccountsDB\n";
my $pydio = $c->get('pydio') || die "pydio entry is missing in the configuration database\n";
my $status = $pydio->prop('status') || 'disabled';
my $indexer = $pydio->prop('Indexer') || 'enabled';
my $defaultIndexer = $pydio->prop('Indexer') || 'enabled';
exit(0) if ($status ne 'enabled' || $indexer ne 'enabled');
exit(0) if ($status ne 'enabled');
# Generate a random ID for our requests
my @chars = ('a'..'z','A..Z','0'..'9');
@ -22,8 +22,8 @@ foreach (0..32){
}
foreach my $share ($a->get_all_by_prop(type => 'share')){
$pydio = $share->prop('Pydio') || 'disabled';
$indexer = $share->prop('PydioIndexer') || 'enabled';
next if ($pydio ne 'enabled' || $indexer ne 'enabled');
$indexer = $share->prop('PydioIndexer') || '';
next if ($pydio ne 'enabled' || $indexer eq 'disabled' || ($indexer ne 'enabled' && $defaultIndexer 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/pydio/indexes/.ajxp_lock-$name"){

Loading…
Cancel
Save