mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 22:10:34 +00:00
♻️ The exporter boots as a queue consumer by default
Nothing of the old exporter deserves preserving: once the plan ends there is no HTTP surface, so the default of `PENPOT_EXPORTER_ROLES` stops being `http` and becomes `worker`. The process that dev and deploy have always started (the tmux window's recipe and the compose service, both untouched) now boots the K pollers of the backend queue; `http` stays selectable by env only until the deletion task takes the legacy surfaces away. AI-assisted-by: glm-5.3-flash
This commit is contained in:
parent
8391fbdf07
commit
dba39c953d
@ -33,9 +33,10 @@
|
||||
:exporter-max-jobs-per-profile 2
|
||||
:exporter-queue-max 64
|
||||
:exporter-job-ttl 3600
|
||||
;; the roles this instance serves: by default only the http service;
|
||||
;; `worker` turns the process into a consumer of the backend jobs
|
||||
:exporter-roles "http"
|
||||
;; the roles this instance serves: by default the consumer of the
|
||||
;; backend jobs queue; `http` keeps the legacy surfaces alive until
|
||||
;; the deletion task takes them away
|
||||
:exporter-roles "worker"
|
||||
:exporter-worker-concurrency 2
|
||||
:wasm-worker-pool-max 2
|
||||
:wasm-worker-pool-min 1
|
||||
|
||||
@ -5,14 +5,16 @@
|
||||
;; Copyright (c) KALEIDOS SUBSIDIARY SL
|
||||
|
||||
(ns app.consumer.config
|
||||
"The worker role of the exporter configuration.
|
||||
"The roles of the exporter process.
|
||||
|
||||
The exporter process may serve its http surfaces, consume the
|
||||
backend `:exporter` queue, or both: `PENPOT_EXPORTER_ROLES` names the
|
||||
roles (`http` by default, `http,worker` during the transition). The
|
||||
worker pieces never read these values at import time: each accessor
|
||||
reads the live configuration, so a long-lived process can be
|
||||
restarted with another role without code changes."
|
||||
`PENPOT_EXPORTER_ROLES` names the roles the process serves: `http`
|
||||
serves the surfaces the exporter used to serve (gone once the
|
||||
deletion task lands), `worker` consumes the backend `:exporter`
|
||||
queue. The default is `worker`: the exporter is a consumer's process,
|
||||
and no surface of it needs to be preserved. The worker pieces never
|
||||
read these values at import time: each accessor reads the live
|
||||
configuration, so a long-lived process can be restarted with another
|
||||
role without code changes."
|
||||
(:require
|
||||
[app.config :as cf]
|
||||
[cljs.core :as c]
|
||||
@ -38,7 +40,7 @@
|
||||
([] (roles (cf/get :exporter-roles)))
|
||||
([spec]
|
||||
(if (nil? spec)
|
||||
#{:http}
|
||||
#{:worker}
|
||||
(scan-roles spec))))
|
||||
|
||||
(defn worker-enabled?
|
||||
|
||||
@ -13,8 +13,11 @@
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
(t/deftest roles-parse-the-env-list
|
||||
(t/testing "the default keeps the http surfaces only"
|
||||
(t/is (= #{:http} (ccfg/roles "http"))))
|
||||
(t/testing "the default serves the worker role only: the exporter is
|
||||
a consumer's process, no surface needs preserving"
|
||||
(t/is (= #{:worker} (ccfg/roles nil)))
|
||||
(t/is (= #{:worker} (ccfg/roles))))
|
||||
(t/is (= #{:http} (ccfg/roles "http")))
|
||||
(t/is (= #{:http :worker} (ccfg/roles "http,worker")))
|
||||
(t/is (= #{:http :worker} (ccfg/roles "http, worker")))
|
||||
(t/testing "the parser does not invent roles from noise"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user