diff --git a/docs/configuration/miscellaneous.md b/docs/configuration/miscellaneous.md index cd34b3e51..728e61dca 100644 --- a/docs/configuration/miscellaneous.md +++ b/docs/configuration/miscellaneous.md @@ -207,28 +207,22 @@ The maximum execution time of a background task (such as running a custom script --- -## RQ_RETRY_MAX - -!!! note - This parameter was added in NetBox v3.5. - -Default: `1` - -The maximum number of times a background task will be retried before being marked as failed. - ---- - ## RQ_RETRY_INTERVAL !!! note This parameter was added in NetBox v3.5. -Default: `[]` +Default: `60` -The number of seconds to wait before retrying a failed background task. This is a list of integers which will be used -as an interval. For example, `[60, 300, 3600]` will retry the task after 1 minute, 5 minutes, and 1 hour. - -!!! warning - If you use the interval, you should run your workers with `--with-scheduler` argument. +This parameter controls how frequently a failed job is retried, up to the maximum number of times specified by `RQ_RETRY_MAX`. This must be either an integer specifying the number of seconds to wait between successive attempts, or a list of such values. For example, `[60, 300, 3600]` will retry the task after 1 minute, 5 minutes, and 1 hour. --- + +## RQ_RETRY_MAX + +!!! note + This parameter was added in NetBox v3.5. + +Default: `0` + +The maximum number of times a background task will be retried before being marked as failed. diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 833eaf9ba..ce5c4bee3 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -140,8 +140,8 @@ REMOTE_AUTH_STAFF_USERS = getattr(configuration, 'REMOTE_AUTH_STAFF_USERS', []) REMOTE_AUTH_GROUP_SEPARATOR = getattr(configuration, 'REMOTE_AUTH_GROUP_SEPARATOR', '|') REPORTS_ROOT = getattr(configuration, 'REPORTS_ROOT', os.path.join(BASE_DIR, 'reports')).rstrip('/') RQ_DEFAULT_TIMEOUT = getattr(configuration, 'RQ_DEFAULT_TIMEOUT', 300) -RQ_RETRY_MAX = getattr(configuration, 'RQ_RETRY_MAX', 1) -RQ_RETRY_INTERVAL = getattr(configuration, 'RQ_RETRY_INTERVAL', []) +RQ_RETRY_INTERVAL = getattr(configuration, 'RQ_RETRY_INTERVAL', 60) +RQ_RETRY_MAX = getattr(configuration, 'RQ_RETRY_MAX', 0) SCRIPTS_ROOT = getattr(configuration, 'SCRIPTS_ROOT', os.path.join(BASE_DIR, 'scripts')).rstrip('/') SEARCH_BACKEND = getattr(configuration, 'SEARCH_BACKEND', 'netbox.search.backends.CachedValueSearchBackend') SECURE_SSL_REDIRECT = getattr(configuration, 'SECURE_SSL_REDIRECT', False)