Skip to content

Commit 193df76

Browse files
committed
feat: Add TASK_POLLING_INTERVAL env var
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 3239525 commit 193df76

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

appinfo/info.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,11 @@ See [the nextcloud admin docs](https://docs.nextcloud.com/server/latest/admin_ma
3333
<image-tag>2.6.0</image-tag>
3434
</docker-install>
3535
<system>false</system>
36+
<environment-variables>
37+
<variable>
38+
<name>TASK_POLLING_INTERVAL</name>
39+
<display-name>Task polling interval</display-name>
40+
<description>The interval in which the app will poll for new tasks, in seconds (can be floating point numbers). This will only be used when running in Kubernetes or with Nextcloud below v33. This value defaults to 5 seconds.</description>
41+
</variable>
3642
</external-app>
3743
</info>

lib/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def log(nc, level, content):
3939
}
4040
app_enabled = Event()
4141
trigger = Event()
42-
CHECK_INTERVAL = 5
42+
CHECK_INTERVAL = float(os.getenv('TASK_POLLING_INTERVAL', '5'))
4343
CHECK_INTERVAL_WITH_TRIGGER = 5 * 60
4444
CHECK_INTERVAL_ON_ERROR = 10
4545
SHUTDOWN_EVENT_RECEIVED = Event()

0 commit comments

Comments
 (0)