Skip to content

Commit

Permalink
Remove legacy settings cache TTL
Browse files Browse the repository at this point in the history
Closes #278
  • Loading branch information
bkis committed Jul 12, 2024
1 parent 5a4cc03 commit cf1a9be
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 32 deletions.
3 changes: 0 additions & 3 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ TEKST_SERVER_URL=http://127.0.0.1:8087
# TEKST_LOG_LEVEL=warning
# default: warning

# TEKST_SETTINGS_CACHE_TTL=60
# default: 60

# TEKST_TEMP_FILES_DIR=/tmp/tekst_tmp
# default: /tmp/tekst_tmp

Expand Down
3 changes: 0 additions & 3 deletions Tekst-API/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
# TEKST_LOG_LEVEL=warning
# default: warning

# TEKST_SETTINGS_CACHE_TTL=60
# default: 60

# TEKST_TEMP_FILES_DIR=/tmp/tekst_tmp
# default: /tmp/tekst_tmp

Expand Down
2 changes: 0 additions & 2 deletions Tekst-API/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ TEKST_DEV_MODE=true
TEKST_LOG_LEVEL=debug
TEKST_DEV__USE_ES=false

TEKST_SETTINGS_CACHE_TTL=0

# database (MongoDB)
TEKST_DB__NAME=tekst_testing

Expand Down
5 changes: 0 additions & 5 deletions Tekst-API/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11898,10 +11898,6 @@
"type": "array",
"title": "Infosegments"
},
"settingsCacheTtl": {
"type": "integer",
"title": "Settingscachettl"
},
"tekst": {
"additionalProperties": {
"type": "string"
Expand All @@ -11917,7 +11913,6 @@
"security",
"systemSegments",
"infoSegments",
"settingsCacheTtl",
"tekst"
],
"title": "PlatformData",
Expand Down
1 change: 0 additions & 1 deletion Tekst-API/tekst/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class TekstConfig(BaseSettings):
dev_mode: bool = False
log_level: str = "warning"

settings_cache_ttl: int = 60
temp_files_dir: DirectoryPath = "/tmp/tekst_tmp"

# config sub sections
Expand Down
1 change: 0 additions & 1 deletion Tekst-API/tekst/models/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class PlatformData(ModelBase):
security: PlatformSecurityInfo
system_segments: list[ClientSegmentRead]
info_segments: list[ClientSegmentHead]
settings_cache_ttl: int
tekst: dict[str, str]


Expand Down
1 change: 0 additions & 1 deletion Tekst-API/tekst/routers/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ async def get_platform_data(ou: OptionalUserDep, cfg: ConfigDep) -> dict:
return PlatformData(
texts=await get_all_texts(ou),
settings=await get_settings(),
settings_cache_ttl=cfg.settings_cache_ttl,
security=PlatformSecurityInfo(),
system_segments=await ClientSegmentDocument.find(
ClientSegmentDocument.is_system_segment == True # noqa: E712
Expand Down
2 changes: 0 additions & 2 deletions Tekst-Web/src/api/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3084,8 +3084,6 @@ export interface components {
systemSegments: components['schemas']['ClientSegmentRead'][];
/** Infosegments */
infoSegments: components['schemas']['ClientSegmentHead'][];
/** Settingscachettl */
settingsCacheTtl: number;
/** Tekst */
tekst: {
[key: string]: string;
Expand Down
8 changes: 1 addition & 7 deletions Tekst-Web/src/views/admin/AdminSystemSettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ async function handleSaveClick() {
// If the current locale is invalid after updating the settings,
// this call will fix it!
await state.setLocale(state.locale);
message.success(
$t('admin.system.platformSettings.msgSaved', {
cacheTTL: pfData.value?.settingsCacheTtl,
}),
undefined,
10
);
message.success($t('admin.system.platformSettings.msgSaved'), undefined, 10);
} else {
resetForm();
}
Expand Down
5 changes: 1 addition & 4 deletions Tekst-Web/translations/ui/deDE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,7 @@ admin:
heading: Einstellungen
headingInfo: Plattform-Informationen
headingOptions: Optionen
msgSaved: |
Plattform-Einstellungen gespeichert.
Bitte beachten Sie, dass es bis zu {cacheTTL} Sekunden dauern kann,
bis die Änderungen sich auf spätere Anfragen auswirken.
msgSaved: Plattform-Einstellungen gespeichert.
defaultTextPlaceholder: Automatisch
formLabelDisplay: Darstellung
maintenance:
Expand Down
3 changes: 1 addition & 2 deletions Tekst-Web/translations/ui/enUS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,7 @@ admin:
heading: Settings
headingInfo: Platform Information
headingOptions: Options
msgSaved: |
Platform settings saved. Please note that it may take up to {cacheTTL} seconds for the changes to take effect on subsequent page loads.
msgSaved: Platform settings saved.
defaultTextPlaceholder: Automatic
formLabelDisplay: Display
maintenance:
Expand Down
1 change: 0 additions & 1 deletion docs/content/setup/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Basic configuration, URL, paths, ...
| `TEKST_WEB_STATIC_DIR` | Local path to static web files directory (String – default: `/var/www/tekst/static/`) |
| `TEKST_DEV_MODE` | Development mode – only use for development! (Boolean – default: `false`) |
| `TEKST_LOG_LEVEL` | API log level (`DEBUG` | `INFO` | `WARNING` | `ERROR` | `CRITICAL` – default: `WARNING`) |
| `TEKST_SETTINGS_CACHE_TTL` | Time-To-Live for the API settings cache (in seconds) (Integer – default: `60`) |
| `TEKST_TEMP_FILES_DIR` | Absolute path to local temporary directory to use (String – default: `/tmp/tekst_tmp`) |


Expand Down

0 comments on commit cf1a9be

Please sign in to comment.