Skip to content
Neil Williams edited this page Jun 3, 2020 · 1 revision

Pass your application's config to the Baseplate constructor

In Baseplate.py v1.2, the Baseplate constructor started accepting an app_config parameter. This is meant to take the raw application config you get from baseplate-serve and baseplate-script so that future features can use it.

It is now deprecated to pass this config directly to configure_observers() or configure_context and future features will likely depend on the config being passed here. Please update now to take advantage.

--- a/my_service/__init__.py
+++ b/my_service/__init__.py
@@ -107,9 +107,9 @@ class Handler:
 def make_processor(app_config: config.RawConfig) -> TProcessor:  # pragma: nocover
     cfg = config.parse_config(app_config, {"activity": {"window": config.Timespan}})
 
-    baseplate = Baseplate()
-    baseplate.configure_observers(app_config)
-    baseplate.configure_context(app_config, {"redis": RedisClient(timeout=0.1)})
+    baseplate = Baseplate(app_config)
+    baseplate.configure_observers()
+    baseplate.configure_context({"redis": RedisClient(timeout=0.1)})
Clone this wiki locally