mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-22 21:50:42 -05:00
refac
This commit is contained in:
1 parent
9221b3b749
commit
7c166fef2a
3 files changed
+5
-3
No files matched your search
@@ -75,9 +75,9 @@ spec:
|
||||
idleTimeoutMinutes:
|
||||
type: integer
|
||||
default: 30
|
||||
minimum: 1
|
||||
minimum: 0
|
||||
description: >-
|
||||
Minutes of inactivity before the terminal pod is stopped.
|
||||
Minutes of inactivity before the terminal pod is stopped. 0 disables idle cleanup.
|
||||
restricted:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
@@ -741,6 +741,8 @@ async def idle_check(spec, status, name, namespace, **_):
|
||||
return
|
||||
|
||||
timeout_minutes = spec.get("idleTimeoutMinutes", 30)
|
||||
if timeout_minutes <= 0:
|
||||
return
|
||||
try:
|
||||
last_dt = datetime.fromisoformat(last_activity.replace("Z", "+00:00"))
|
||||
except (ValueError, TypeError):
|
||||
|
||||
@@ -217,7 +217,7 @@ class KubernetesOperatorBackend(Backend):
|
||||
|
||||
# Idle timeout
|
||||
idle_timeout = s.get("idle_timeout_minutes", settings.idle_timeout_minutes)
|
||||
if idle_timeout and idle_timeout > 0:
|
||||
if idle_timeout is not None and idle_timeout >= 0:
|
||||
cr_spec["idleTimeoutMinutes"] = idle_timeout
|
||||
|
||||
policy_slug = _DNS_SAFE.sub("-", policy_id.lower()).strip("-")[:20]
|
||||
|
||||
Reference in new issue
Block a user