opentf-toolkit-nightly 0.62.0.dev1291__py3-none-any.whl → 0.62.0.dev1295__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opentf/commons/__init__.py +26 -9
- opentf/toolkit/__init__.py +6 -1
- {opentf_toolkit_nightly-0.62.0.dev1291.dist-info → opentf_toolkit_nightly-0.62.0.dev1295.dist-info}/METADATA +1 -1
- {opentf_toolkit_nightly-0.62.0.dev1291.dist-info → opentf_toolkit_nightly-0.62.0.dev1295.dist-info}/RECORD +7 -7
- {opentf_toolkit_nightly-0.62.0.dev1291.dist-info → opentf_toolkit_nightly-0.62.0.dev1295.dist-info}/LICENSE +0 -0
- {opentf_toolkit_nightly-0.62.0.dev1291.dist-info → opentf_toolkit_nightly-0.62.0.dev1295.dist-info}/WHEEL +0 -0
- {opentf_toolkit_nightly-0.62.0.dev1291.dist-info → opentf_toolkit_nightly-0.62.0.dev1295.dist-info}/top_level.txt +0 -0
opentf/commons/__init__.py
CHANGED
|
@@ -181,7 +181,10 @@ def _get_contextparameter_spec(app: Flask, name: str) -> Optional[Dict[str, Any]
|
|
|
181
181
|
Initialize cache if needed, ignoring context parameters specs from
|
|
182
182
|
other services.
|
|
183
183
|
|
|
184
|
-
Adds the
|
|
184
|
+
Adds the following specs if not already present:
|
|
185
|
+
|
|
186
|
+
- `watchdog_polling_delay_seconds`
|
|
187
|
+
- `availability_check_delay_seconds`
|
|
185
188
|
"""
|
|
186
189
|
if PARAMETERS_KEY not in app.config:
|
|
187
190
|
app.config[PARAMETERS_KEY] = []
|
|
@@ -191,14 +194,28 @@ def _get_contextparameter_spec(app: Flask, name: str) -> Optional[Dict[str, Any]
|
|
|
191
194
|
app.config[PARAMETERS_KEY] += manifest.get('spec', {}).get(
|
|
192
195
|
'contextParameters', []
|
|
193
196
|
)
|
|
194
|
-
app.config[PARAMETERS_KEY]
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
197
|
+
known = {spec['name'] for spec in app.config[PARAMETERS_KEY]}
|
|
198
|
+
if 'watchdog_polling_delay_seconds' not in known:
|
|
199
|
+
app.config[PARAMETERS_KEY].append(
|
|
200
|
+
{
|
|
201
|
+
'name': 'watchdog_polling_delay_seconds',
|
|
202
|
+
'descriptiveName': 'files watchdog polling delay in seconds',
|
|
203
|
+
'default': 30,
|
|
204
|
+
'type': 'int',
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
if 'availability_check_delay_seconds' not in known:
|
|
208
|
+
app.config[PARAMETERS_KEY].append(
|
|
209
|
+
{
|
|
210
|
+
'name': 'availability_check_delay_seconds',
|
|
211
|
+
'deprecatedNames': ['availability_check_delay'],
|
|
212
|
+
'descriptiveName': 'availability check frequency in seconds',
|
|
213
|
+
'type': 'int',
|
|
214
|
+
'default': 10,
|
|
215
|
+
'minValue': 10,
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
|
|
202
219
|
app.logger.info('Configuration:')
|
|
203
220
|
parameters = app.config[PARAMETERS_KEY]
|
|
204
221
|
try:
|
opentf/toolkit/__init__.py
CHANGED
|
@@ -58,6 +58,7 @@ DISPATCHQUEUE_KEY = '__dispatch queue__'
|
|
|
58
58
|
|
|
59
59
|
WATCHDOG_POLLING_DELAY_SECONDS = 30
|
|
60
60
|
WATCHDOG_POLLING_DELAY_KEY = 'watchdog_polling_delay_seconds'
|
|
61
|
+
AVAILABILITY_CHECK_DELAY_SECONDS = 'availability_check_delay_seconds'
|
|
61
62
|
|
|
62
63
|
Handler = Callable[[Dict[str, Any]], Any]
|
|
63
64
|
|
|
@@ -398,6 +399,10 @@ def watch_file(plugin: Flask, path: str, handler, *args, **kwargs) -> None:
|
|
|
398
399
|
a file path (a string). It may take additional parameters. It will
|
|
399
400
|
be called whenever the file changes.
|
|
400
401
|
|
|
402
|
+
The watchdog polls every 30 seconds by default. This can be
|
|
403
|
+
adjusted by setting the `watchdog_polling_delay_seconds` context
|
|
404
|
+
parameter (but it cannot be more frequent).
|
|
405
|
+
|
|
401
406
|
# Required parameters
|
|
402
407
|
|
|
403
408
|
- plugin: a Flask application
|
|
@@ -460,7 +465,7 @@ def watch_and_notify(
|
|
|
460
465
|
- items: an iterable
|
|
461
466
|
- notify: a function of no arguments
|
|
462
467
|
"""
|
|
463
|
-
polling_delay = get_context_parameter(plugin,
|
|
468
|
+
polling_delay = get_context_parameter(plugin, AVAILABILITY_CHECK_DELAY_SECONDS)
|
|
464
469
|
|
|
465
470
|
plugin.logger.debug('Starting watch notifier thread.')
|
|
466
471
|
threading.Thread(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: opentf-toolkit-nightly
|
|
3
|
-
Version: 0.62.0.
|
|
3
|
+
Version: 0.62.0.dev1295
|
|
4
4
|
Summary: OpenTestFactory Orchestrator Toolkit
|
|
5
5
|
Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
|
|
6
6
|
Author: Martin Lafaix
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
opentf/commons/__init__.py,sha256=
|
|
1
|
+
opentf/commons/__init__.py,sha256=2hd1g14g9pnZl1uip6Sh90YSmLDWzkH1SGeZweRJ4z8,24180
|
|
2
2
|
opentf/commons/auth.py,sha256=gXRp_0Tf3bfd65F4QiQmh6C6vR9y3ugag_0DSvozJFk,15898
|
|
3
3
|
opentf/commons/config.py,sha256=RVSSdQhMle4oCo_z_AR2EQ4U6sUjSxw-qVBtjKuJVfo,10219
|
|
4
4
|
opentf/commons/exceptions.py,sha256=7dhUXO8iyAbqVwlUKxZhgRzGqVcb7LkG39hFlm-VxIA,2407
|
|
@@ -55,11 +55,11 @@ opentf/schemas/opentestfactory.org/v1beta1/Workflow.json,sha256=QZ8mM9PhzsI9gTmw
|
|
|
55
55
|
opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG94_qYgR_GnLWNsaQhaQ-2kuZdWJr5NnY,3517
|
|
56
56
|
opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
|
|
57
57
|
opentf/scripts/startup.py,sha256=vOGxl7xBcp1-_LsAKiOmeOqFl2iT81A2XRrXBLUrNi4,22785
|
|
58
|
-
opentf/toolkit/__init__.py,sha256=
|
|
58
|
+
opentf/toolkit/__init__.py,sha256=ohrde5mcMY26p64E0Z2XunZAWYOiEkXKTg5E1J4TGGc,23571
|
|
59
59
|
opentf/toolkit/channels.py,sha256=whLfPVT5PksVlprmoeb2ktaZ3KEhqyryUCVWBJq7PeY,24308
|
|
60
60
|
opentf/toolkit/core.py,sha256=fqnGgaYnuVcd4fyeNIwpc0QtyUo7jsKeVgdkBfY3iqo,9443
|
|
61
|
-
opentf_toolkit_nightly-0.62.0.
|
|
62
|
-
opentf_toolkit_nightly-0.62.0.
|
|
63
|
-
opentf_toolkit_nightly-0.62.0.
|
|
64
|
-
opentf_toolkit_nightly-0.62.0.
|
|
65
|
-
opentf_toolkit_nightly-0.62.0.
|
|
61
|
+
opentf_toolkit_nightly-0.62.0.dev1295.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
62
|
+
opentf_toolkit_nightly-0.62.0.dev1295.dist-info/METADATA,sha256=Dftf4ExDEznTennMkNJ7wCZoK1HONVmPhb_jwMqi6W4,2192
|
|
63
|
+
opentf_toolkit_nightly-0.62.0.dev1295.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
64
|
+
opentf_toolkit_nightly-0.62.0.dev1295.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
|
|
65
|
+
opentf_toolkit_nightly-0.62.0.dev1295.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|