Просмотр исходного кода

Closes #4119: Extend upgrade script to clear expired user sessions

Jeremy Stretch 6 лет назад
Родитель
Сommit
746bfd8bca
3 измененных файлов с 9 добавлено и 0 удалено
  1. 3 0
      docs/installation/upgrading.md
  2. 1 0
      docs/release-notes/version-2.7.md
  3. 5 0
      upgrade.sh

+ 3 - 0
docs/installation/upgrading.md

@@ -74,6 +74,9 @@ This script:
 * Installs all required Python packages
 * Applies any database migrations that were included in the release
 * Collects all static files to be served by the HTTP service
+* Deletes stale content types from the database
+* Deletes all expired user sessions from the database
+* Clears all cached data to prevent conflicts with the new release
 
 !!! note
     It's possible that the upgrade script will display a notice warning of unreflected database migrations:

+ 1 - 0
docs/release-notes/version-2.7.md

@@ -5,6 +5,7 @@
 ## Enhancements
 
 * [#3949](https://github.com/netbox-community/netbox/issues/3949) - Revised the installation docs and upgrade script to employ a Python virtual environment
+* [#4119](https://github.com/netbox-community/netbox/issues/4119) - Extend upgrade script to clear expired user sessions
 * [#4218](https://github.com/netbox-community/netbox/issues/4218) - Allow negative voltage for DC power feeds
 * [#4281](https://github.com/netbox-community/netbox/issues/4281) - Allow filtering device component list views by type
 * [#4284](https://github.com/netbox-community/netbox/issues/4284) - Add MRJ21 port and cable types

+ 5 - 0
upgrade.sh

@@ -48,6 +48,11 @@ COMMAND="python3 netbox/manage.py remove_stale_contenttypes --no-input"
 echo "Removing stale content types ($COMMAND)..."
 eval $COMMAND
 
+# Delete any expired user sessions
+COMMAND="python3 netbox/manage.py clearsessions"
+echo "Removing expired user sessions ($COMMAND)..."
+eval $COMMAND
+
 # Clear all cached data
 COMMAND="python3 netbox/manage.py invalidate all"
 echo "Clearing cache data ($COMMAND)..."