Correctly unlink lock files in indexer script
This commit is contained in:
parent
bc5240af4f
commit
68d86c7b17
|
@ -28,7 +28,7 @@ foreach my $share ($a->get_all_by_prop(type => 'share')){
|
||||||
# Check if the lock file is present and if it's too old (last index crashed ?)
|
# 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"){
|
if (-e "/var/cache/ajaxplorer/indexes/.ajxp_lock-$name"){
|
||||||
my $mtime = stat("/var/cache/ajaxplorer/indexes/.ajxp_lock-$name")->mtime;
|
my $mtime = stat("/var/cache/ajaxplorer/indexes/.ajxp_lock-$name")->mtime;
|
||||||
unlink <"/var/cache/ajaxplorer/indexes/.ajxp_lock-$name">
|
unlink </var/cache/ajaxplorer/indexes/.ajxp_lock-$name>
|
||||||
if (time() - $mtime > 18000);
|
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 ' .
|
||||||
|
@ -36,7 +36,7 @@ foreach my $share ($a->get_all_by_prop(type => 'share')){
|
||||||
'-t=e71479ebc4365176d9f09fe957780024 -a=index '.
|
'-t=e71479ebc4365176d9f09fe957780024 -a=index '.
|
||||||
'-r='.$name.' --secure_token='.$id.' --dir=/ --_method=put >/dev/null 2>&1');
|
'-r='.$name.' --secure_token='.$id.' --dir=/ --_method=put >/dev/null 2>&1');
|
||||||
# In some cases, the lock file is not removed, make sure it's unlocked
|
# In some cases, the lock file is not removed, make sure it's unlocked
|
||||||
unlink <"/var/cache/ajaxplorer/indexes/.ajxp_lock-$name">;
|
unlink </var/cache/ajaxplorer/indexes/.ajxp_lock-$name>;
|
||||||
}
|
}
|
||||||
# We should now restart OOo to release memory
|
# We should now restart OOo to release memory
|
||||||
if (-d '/var/service/ooo'){
|
if (-d '/var/service/ooo'){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user