From b416e7aa42bae014218b6cbc80f37a792af33610 Mon Sep 17 00:00:00 2001 From: Edward Oliveira Date: Sat, 18 Apr 2026 16:34:03 -0300 Subject: [PATCH] feat: run backfill_file_metadata as background job on pod startup Launches the management command in the background immediately after migrations so FileMetadata rows are populated for pre-existing files without delaying pod readiness. A comment marks the line for removal once the fleet is fully backfilled. Co-Authored-By: Claude Sonnet 4.6 --- docker/startup_scripts/start.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/startup_scripts/start.sh b/docker/startup_scripts/start.sh index bd98bdfc0..554845b4e 100755 --- a/docker/startup_scripts/start.sh +++ b/docker/startup_scripts/start.sh @@ -275,6 +275,11 @@ main() { setup_cache_dir fix_logging_and_socket_perms + # Backfill FileMetadata rows for files uploaded before MetadataFileField was + # deployed. Runs as a background job so pod startup is not delayed. + # Once all instances have been fully backfilled this line can be removed. + python3 manage.py backfill_file_metadata --batch-size=200 --rate-limit=20 & + cat <<'BANNER' ------------------------------------- | ███████╗ █████╗ ██████╗ ██╗ |