Parcourir la source

Document the rebuild_config_context_cache management command

The command is introduced in v4.7 and invoked by the upgrade script, but was
absent from the management commands reference. Record what it does, when an
operator would run it by hand, and that it is safe to interrupt, re-run, or
defer, since an object whose cache is empty renders its config context on
demand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Jeremy Stretch il y a 21 heures
Parent
commit
07985b51eb
1 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 10 0
      docs/administration/management-commands.md

+ 10 - 0
docs/administration/management-commands.md

@@ -34,6 +34,16 @@ Populate the cached file size for image attachments that predate the `image_size
 python3 netbox/manage.py populate_image_sizes
 ```
 
+## rebuild_config_context_cache
+
+Pre-render and cache the merged config context data for all devices and virtual machines. The [upgrade script](../installation/upgrading.md) runs this automatically, so it is not usually necessary to invoke it by hand. It is useful to complete an interrupted run, or to repair the cache after a bulk write which bypassed NetBox's change handling (cache invalidation is driven by model signals, which a direct `queryset.update()` does not emit).
+
+By default, only those objects whose cache is empty are rendered, so the command is safe to interrupt and re-run; pass `--force` to re-render every object. Either form may be run on a live system, as any object whose cache is empty falls back to rendering its config context on demand. See [Context Data](../features/context-data.md) for details.
+
+```
+python3 netbox/manage.py rebuild_config_context_cache [--force]
+```
+
 ## rebuild_prefixes
 
 Rebuild the IPAM prefix hierarchy, recalculating the depth and child counts for all prefixes.