]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix usage of the Redis config schema as `extra_fields`
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 5 Feb 2023 12:29:37 +0000 (12:29 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 5 Feb 2023 12:29:37 +0000 (12:29 +0000)
Issue: #4318

lualib/lua_redis.lua

index acbb4696911919a0012612c6e3f0f5baf8c8330c..d41805eca8c373fcfc122587d77eef343dd7ea92 100644 (file)
@@ -39,6 +39,13 @@ local common_schema = ts.shape {
 }
 
 local config_schema =
+  -- Allow separate read/write servers to allow usage in the `extra_fields`
+  ts.shape({
+    read_servers = ts.string + ts.array_of(ts.string),
+  }, {extra_fields = common_schema}) +
+  ts.shape({
+    write_servers = ts.string + ts.array_of(ts.string),
+  }, {extra_fields = common_schema}) +
   ts.shape({
     read_servers = ts.string + ts.array_of(ts.string),
     write_servers = ts.string + ts.array_of(ts.string),