Files
integreat/src/clj/auto_ap/jobs/core.clj
Bryce ba87805d4c Add vendor pre-population for bulk code and individual edit forms
- Add vendor-changed HTMX handlers for both bulk code and individual edit
- Pre-populate default account at 100% when vendor is selected and no accounts exist
- Fix render-accounts-section to render from step-params correctly
- Change bulk code vendor-changed from hx-get to hx-post to include form data
- Add routes for vendor-changed endpoints
- Update e2e tests to cover vendor pre-population
- Run lein cljfmt fix across codebase
2026-05-21 14:45:19 -07:00

28 lines
1.1 KiB
Clojure

(ns auto-ap.jobs.core
(:require [auto-ap.utils :refer [heartbeat]]
[mount.core :as mount]
[auto-ap.datomic :refer [conn]]
[auto-ap.logging :as alog]
[nrepl.server :refer [start-server]]
[auto-ap.background.metrics :refer [metrics-setup container-tags container-data logging-context]]
[com.brunobonacci.mulog :as mu]))
(defn execute [name f]
(mu/with-context {:background-job name
:source name
:service name}
(mu/trace ::execute-background-job
[]
(try
(mount/start (mount/only #{#'conn #'metrics-setup #'container-tags #'logging-context #'container-data}))
(start-server :port 9000 :bind "0.0.0.0" #_#_:handler (cider-nrepl-handler))
((heartbeat f name))
(alog/info ::stopping :job name)
(Thread/sleep 15000)
(mount/stop)
(catch Exception e
(alog/error ::job-error :error e)
(throw e))
(finally
(System/exit 0))))))