- my $nolock=($config{post_commit} && ! IkiWiki::commit_hook_enabled());
- IkiWiki::lockwiki() unless $nolock;
- loadstate();
- if ($config{aggregate} && ! $nolock) {
+ if ($config{aggregate} && ! ($config{post_commit} &&
+ IkiWiki::commit_hook_enabled())) {
+ if (! IkiWiki::lockwiki(0)) {
+ debug("wiki is locked by another process, not aggregating");
+ exit 1;
+ }
+
+ loadstate();