This commit is contained in:
Classic298
2026-01-29 17:53:35 +01:00
committed by GitHub
parent 27f9defab4
commit d63d247c37
9 changed files with 159 additions and 17 deletions

View File

@@ -215,6 +215,13 @@ WEBSOCKET_REDIS_OPTIONS='{"socket_connect_timeout": 5}'
:::
#### Retry and Reconnect Logic
To enhance resilience during Sentinel failover—the window when a new master is being elected and promoted—you can configure retry behavior to prevent the application from exhausting its reconnection attempts too quickly.
- **`REDIS_SENTINEL_MAX_RETRY_COUNT`**: Sets the maximum number of retries for Redis operations when using Sentinel (Default: `2`).
- **`REDIS_RECONNECT_DELAY`**: Adds an optional delay in **milliseconds** between retry attempts (e.g., `REDIS_RECONNECT_DELAY=500`). This prevents tight retry loops that may otherwise overwhelm the event loop or block the application before a new master is ready.
### Complete Example Configuration
Here's a complete example showing all Redis-related environment variables:
@@ -229,6 +236,8 @@ WEBSOCKET_REDIS_URL="redis://redis-valkey:6379/1"
# Recommended for Sentinel deployments (prevents failover hangs)
REDIS_SOCKET_CONNECT_TIMEOUT=5
REDIS_SENTINEL_MAX_RETRY_COUNT=5
REDIS_RECONNECT_DELAY=1000
# Optional
REDIS_KEY_PREFIX="open-webui"

View File

@@ -79,9 +79,10 @@ Here is a complete list of tables in Open-WebUI's SQLite database. The tables ar
| 23 | note | Stores user-created notes and annotations |
| 24 | oauth_session | Manages active OAuth sessions for users |
| 25 | prompt | Stores templates and configurations for AI prompts |
| 26 | tag | Manages tags/labels for content categorization |
| 27 | tool | Stores configurations for system tools and integrations |
| 28 | user | Maintains user profiles and account information |
| 26 | prompt_history | Tracks version history and snapshots for prompts |
| 27 | tag | Manages tags/labels for content categorization |
| 28 | tool | Stores configurations for system tools and integrations |
| 29 | user | Maintains user profiles and account information |
Note: there are two additional tables in Open-WebUI's SQLite database that are not related to Open-WebUI's core functionality, that have been excluded:
@@ -446,14 +447,33 @@ The `access_control` fields expected structure:
## Prompt Table
| **Column Name** | **Data Type** | **Constraints** | **Description** |
| --------------- | ------------- | --------------- | ------------------------- |
| command | String | PRIMARY KEY | Unique command identifier |
| user_id | String | - | Prompt owner |
| title | Text | - | Prompt title |
| content | Text | - | Prompt content/template |
| timestamp | BigInteger | - | Last update timestamp |
| access_control | JSON | nullable | Access permissions |
| **Column Name** | **Data Type** | **Constraints** | **Description** |
| --------------- | ------------- | --------------- | ----------------------------------- |
| id | Text | PRIMARY KEY | Unique identifier (UUID) |
| command | String | UNIQUE, INDEX | Unique command identifier |
| user_id | String | NOT NULL | Owner of the prompt |
| name | Text | NOT NULL | Display name of the prompt |
| content | Text | NOT NULL | Prompt content/template |
| data | JSON | nullable | Additional prompt data |
| meta | JSON | nullable | Prompt metadata |
| access_control | JSON | nullable | Permission settings |
| is_active | Boolean | default=True | Active status |
| version_id | Text | nullable | Current version identifier |
| tags | JSON | nullable | Associated tags |
| created_at | BigInteger | NOT NULL | Creation timestamp |
| updated_at | BigInteger | NOT NULL | Last update timestamp |
## Prompt History Table
| **Column Name** | **Data Type** | **Constraints** | **Description** |
| --------------- | ------------- | ------------------------------ | --------------------------------- |
| id | Text | PRIMARY KEY | Unique identifier (UUID) |
| prompt_id | Text | FOREIGN KEY(prompt.id), INDEX | Reference to the prompt |
| parent_id | Text | nullable | Reference to the parent version |
| snapshot | JSON | NOT NULL | Snapshot of the prompt at version |
| user_id | Text | NOT NULL | User who created the version |
| commit_message | Text | nullable | Version commit message |
| created_at | BigInteger | NOT NULL | Creation timestamp |
## Tag Table
@@ -524,6 +544,8 @@ erDiagram
user ||--o{ memory : "owns"
user ||--o{ model : "manages"
user ||--o{ prompt : "creates"
user ||--o{ prompt_history : "creates"
prompt ||--o{ prompt_history : "has"
user ||--o{ tag : "creates"
user ||--o{ tool : "manages"
user ||--o{ note : "owns"
@@ -698,11 +720,26 @@ erDiagram
}
prompt {
string command PK
text id PK
string command
string user_id FK
text title
text name
text content
json data
json meta
json access_control
boolean is_active
text version_id
json tags
}
prompt_history {
text id PK
text prompt_id FK
text parent_id FK
json snapshot
text user_id FK
text commit_message
}
tag {