Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HELpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
HELpy
Commits
d19cdfd1
Commit
d19cdfd1
authored
2 months ago
by
Krzysztof Mochocki
Browse files
Options
Downloads
Patches
Plain Diff
Add initialization timeout to settings
parent
2f1b97a7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!73
Clive integration related fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beekeepy/beekeepy/_handle/beekeeper.py
+3
-1
3 additions, 1 deletion
beekeepy/beekeepy/_handle/beekeeper.py
beekeepy/beekeepy/_interface/settings.py
+7
-0
7 additions, 0 deletions
beekeepy/beekeepy/_interface/settings.py
with
10 additions
and
1 deletion
beekeepy/beekeepy/_handle/beekeeper.py
+
3
−
1
View file @
d19cdfd1
...
@@ -107,7 +107,9 @@ class BeekeeperCommon(BeekeeperNotificationCallbacks, ABC):
...
@@ -107,7 +107,9 @@ class BeekeeperCommon(BeekeeperNotificationCallbacks, ABC):
def
__wait_till_ready
(
self
)
->
None
:
def
__wait_till_ready
(
self
)
->
None
:
assert
self
.
__notification_event_handler
is
not
None
,
"
Notification event handler hasn
'
t been set
"
assert
self
.
__notification_event_handler
is
not
None
,
"
Notification event handler hasn
'
t been set
"
if
not
self
.
__notification_event_handler
.
http_listening_event
.
wait
(
timeout
=
5
):
if
not
self
.
__notification_event_handler
.
http_listening_event
.
wait
(
timeout
=
self
.
_get_settings
().
initialization_timeout
.
total_seconds
()
):
raise
TimeoutError
(
"
Waiting too long for beekeeper to be up and running
"
)
raise
TimeoutError
(
"
Waiting too long for beekeeper to be up and running
"
)
def
_handle_error
(
self
,
error
:
Error
)
->
None
:
def
_handle_error
(
self
,
error
:
Error
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
beekeepy/beekeepy/_interface/settings.py
+
7
−
0
View file @
d19cdfd1
...
@@ -16,11 +16,13 @@ class Settings(HandleSettings):
...
@@ -16,11 +16,13 @@ class Settings(HandleSettings):
WORKING_DIRECTORY
:
ClassVar
[
str
]
=
"
BEEKEEPY_WORKING_DIRECTORY
"
WORKING_DIRECTORY
:
ClassVar
[
str
]
=
"
BEEKEEPY_WORKING_DIRECTORY
"
PROPAGATE_SIGINT
:
ClassVar
[
str
]
=
"
BEEKEEPY_PROPAGATE_SIGINT
"
PROPAGATE_SIGINT
:
ClassVar
[
str
]
=
"
BEEKEEPY_PROPAGATE_SIGINT
"
CLOSE_TIMEOUT
:
ClassVar
[
str
]
=
"
BEEKEEPY_CLOSE_TIMEOUT
"
CLOSE_TIMEOUT
:
ClassVar
[
str
]
=
"
BEEKEEPY_CLOSE_TIMEOUT
"
INITIALIZATION_TIMEOUT
:
ClassVar
[
str
]
=
"
BEEKEEPY_INITIALIZATION_TIMEOUT
"
class
Defaults
(
HandleSettings
.
Defaults
):
class
Defaults
(
HandleSettings
.
Defaults
):
WORKING_DIRECTORY
:
ClassVar
[
Path
]
=
Path
.
cwd
()
WORKING_DIRECTORY
:
ClassVar
[
Path
]
=
Path
.
cwd
()
PROPAGATE_SIGINT
:
ClassVar
[
bool
]
=
True
PROPAGATE_SIGINT
:
ClassVar
[
bool
]
=
True
CLOSE_TIMEOUT
:
ClassVar
[
timedelta
]
=
timedelta
(
seconds
=
10.0
)
CLOSE_TIMEOUT
:
ClassVar
[
timedelta
]
=
timedelta
(
seconds
=
10.0
)
INITIALIZATION_TIMEOUT
:
ClassVar
[
timedelta
]
=
timedelta
(
seconds
=
5.0
)
working_directory
:
Path
|
None
=
None
working_directory
:
Path
|
None
=
None
"""
Path, where beekeeper binary will store all it
'
s data and logs.
"""
"""
Path, where beekeeper binary will store all it
'
s data and logs.
"""
...
@@ -49,6 +51,11 @@ class Settings(HandleSettings):
...
@@ -49,6 +51,11 @@ class Settings(HandleSettings):
)
)
"""
Affects time handle waits before beekeepy closes.
"""
"""
Affects time handle waits before beekeepy closes.
"""
initialization_timeout
:
timedelta
=
Defaults
.
default_factory
(
EnvironNames
.
INITIALIZATION_TIMEOUT
,
lambda
x
:
(
Settings
.
Defaults
.
INITIALIZATION_TIMEOUT
if
x
is
None
else
timedelta
(
seconds
=
int
(
x
))),
)
@property
@property
def
ensured_working_directory
(
self
)
->
Path
:
def
ensured_working_directory
(
self
)
->
Path
:
"""
This property should be used to make sure, that path to working dir is returned.
"""
This property should be used to make sure, that path to working dir is returned.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment