zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

commit b088c58baaa4e6fef2f5a19e0729b43c8c7da61d
parent d9b5c84abadfb112f56f5b9fb500063b6670cfb2
Author: srfsh <dev@srf.sh>
Date:   Mon, 22 Aug 2022 18:22:53 +0300

conf: add gql page size vars

Diffstat:
Mconf/.env.templ | 4++++
Mconf/runtime.exs | 13+++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/conf/.env.templ b/conf/.env.templ @@ -33,3 +33,7 @@ export ROOM_SALT=@ROOM_SALT ## admin export ADMIN_KEY=@ADMIN_KEY + +## gql +export GQL_DEF_PAGE_SIZE=50 +export GQL_MAX_PAGE_SIZE=100 diff --git a/conf/runtime.exs b/conf/runtime.exs @@ -81,3 +81,16 @@ if byte_size(admin_key) != 64, do: raise "ADMIN_KEY must be a 64-octect long, lowercase-base16-encoded string" config :zenflows, Zenflows.Admin, admin_key: admin_key + +# +# gql +# +def_page_size = get_env_int.("GQL_DEF_PAGE_SIZE", 50) +if def_page_size < 1, + do: raise "GQL_DEF_PAGE_SIZE must be greater than 1" +max_page_size = get_env_int.("GQL_MAX_PAGE_SIZE", 100) +if max_page_size < def_page_size, + do: raise "GQL_MAX_PAGE_SIZE can't be less than GQL_DEF_PAGE_SIZE" +config :zenflows, Zenflows.GQL, + def_page_size: def_page_size, + max_page_size: max_page_size