Skip to content

Commit 82123ef

Browse files
committed
Run SMW rebuildData.php in background to avoid blocking startup
On large wikis, rebuildData.php can take a very long time. Running it synchronously blocks the entire container startup: the web server, log permission setup, and php-fpm never start, leaving the site completely down with no maintenance banner. Wrap the rebuildData block in a background subshell so services start immediately. The .maintenance flag already provides a maintenance banner while background tasks complete. Fixes #91
1 parent cfc707f commit 82123ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

_sources/scripts/run-all.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ if [ -n "$MW_SECRET_KEY" ] || [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [
176176
# Rebuild Semantic MediaWiki data for any wikis that were just set up.
177177
# setupStore.php (run by update.php hooks) creates tables but does not
178178
# populate them — rebuildData.php is needed for Special:Browse etc.
179+
# Run in background to avoid blocking container startup on large wikis.
180+
(
179181
if [ -f "$MW_HOME/extensions/SemanticMediaWiki/extension.json" ]; then
180182
wiki_ids=$(get_wiki_ids)
181183
if [ -n "$wiki_ids" ]; then
@@ -197,6 +199,7 @@ if [ -n "$MW_SECRET_KEY" ] || [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [
197199
fi
198200
fi
199201
fi
202+
) &
200203
fi
201204

202205
# Configure Apache rewrites for path-based wikis (e.g., localhost/wiki2)

0 commit comments

Comments
 (0)