Skip to content
Snippets Groups Projects

msobczyk/handle signals in docker entrypoint

Merged Marcin Sobczyk requested to merge msobczyk/handle-signals-in-docker-entrypoint into develop
Compare and Show latest version
12 files
+ 157
159
Compare changes
  • Side-by-side
  • Inline
Files
12
@@ -88,7 +88,7 @@ class Beekeeper:
if not (Beekeeper.get_remote_address_from_settings() or Beekeeper.get_path_from_settings()):
raise BeekeeperNotConfiguredError
self.__communication = Communication(timeout_secs=self.DEFAULT_TIMEOUT_TOTAL_SECONDS)
self.__communication = Communication(timeout_total_secs=self.DEFAULT_TIMEOUT_TOTAL_SECONDS)
self.__run_in_background = run_in_background
self.is_running = False
self.is_starting = False
@@ -123,6 +123,7 @@ class Beekeeper:
webserver_thread_pool_size: int = BeekeeperDefaults.DEFAULT_WEBSERVER_THREAD_POOL_SIZE,
webserver_http_endpoint: Url | None = BeekeeperDefaults.DEFAULT_WEBSERVER_HTTP_ENDPOINT,
) -> Self:
await self.__communication.setup()
arguments: BeekeeperCLIArguments = BeekeeperCLIArguments(
help=BeekeeperDefaults.DEFAULT_HELP,
version=BeekeeperDefaults.DEFAULT_VERSION,
@@ -190,11 +191,11 @@ class Beekeeper:
def modified_connection_details(
self,
max_attempts: int = Communication.DEFAULT_ATTEMPTS,
timeout_secs: float = DEFAULT_TIMEOUT_TOTAL_SECONDS,
timeout_total_secs: float = DEFAULT_TIMEOUT_TOTAL_SECONDS,
pool_time_secs: float = Communication.DEFAULT_POOL_TIME_SECONDS,
) -> Iterator[None]:
"""Allow to temporarily change connection details."""
with self.__communication.modified_connection_details(max_attempts, timeout_secs, pool_time_secs):
with self.__communication.modified_connection_details(max_attempts, timeout_total_secs, pool_time_secs):
yield
@staticmethod
@@ -268,6 +269,7 @@ class Beekeeper:
self.__token = None
await self.__close_beekeeper()
self.is_running = False
await self.__communication.teardown()
logger.info("Beekeeper closed.")
def attach_wallet_closing_listener(self, listener: WalletClosingListener) -> None:
Loading