From e3e4af9a1a46d57bf47c34b23f46f036fc2b4dd6 Mon Sep 17 00:00:00 2001 From: Mike Cook Date: Thu, 4 Nov 2021 19:47:48 +0000 Subject: [PATCH] Fail over to environmental storage URL config `ModelPool.createModel` is always called with empty config, so always breaks when using non-default storage URLs e.g. `HUBOT_MARKOV_STORAGE_URL=postgres://postgres:password@localhost:5432/hubot`. This change keeps the current behaviour, but fails over to look up the instance config, which is provided from env vars and passed into the instance in the module root --- src/model-pool.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model-pool.coffee b/src/model-pool.coffee index d302f8d..bcdc5e4 100644 --- a/src/model-pool.coffee +++ b/src/model-pool.coffee @@ -40,7 +40,7 @@ class ModelPool else storageImpl = @defaultStorageImpl - storage = new storageImpl(options.storageUrl, name, @robot) + storage = new storageImpl(options.storageUrl or @config.storageUrl, name, @robot) storage.initialize (err) -> if err? queue.failed()