simplifications, remove unused code

This commit is contained in:
Helmut Merz 2024-06-29 20:23:52 +02:00
parent ac903f1f19
commit 19bba29a01
2 changed files with 8 additions and 11 deletions

View file

@ -60,22 +60,19 @@
(defclass base (common) (defclass base (common)
((env-slots :reader env-slots :initform nil :allocation :class) ((env-slots :reader env-slots :initform nil :allocation :class)
(name :reader name :initarg :name) (name :reader name :initarg :name)
(parent :reader parent :initarg :parent) (parent :accessor parent :initarg :parent)
(setup :reader setup :initarg :setup :initform #'(lambda (cfg))) (setup :reader setup :initarg :setup :initform #'(lambda (cfg)))
(shutdown :reader shutdown :initarg :shutdown :initform #'(lambda (ctx))) (shutdown :reader shutdown :initarg :shutdown :initform #'(lambda (ctx)))
(actions :accessor actions :initarg :actions :initform nil))) (actions :accessor actions :initarg :actions :initform nil)))
(defmethod initialize-instance :after ((cfg base) &key parent &allow-other-keys) (defmethod initialize-instance :after ((cfg base) &key parent &allow-other-keys)
(when parent (if parent
(push cfg (children parent)) (push cfg (children parent)))
(env-override cfg)))
(defmethod (setf parent) ((cfg base) (parent common))
(push cfg (children parent))
(env-override cfg)) (env-override cfg))
(defmethod env-data ((cfg base)) (defmethod (setf parent) ((cfg base) (parent common))
(env-data (parent cfg))) (setf (parent cfg) parent)
(push cfg (children parent)))
(defun add (name &rest params (defun add (name &rest params
&key (class 'base) (parent *root*) &key (class 'base) (parent *root*)
@ -101,4 +98,4 @@
(setf (slot-value obj sl) val)))))) (setf (slot-value obj sl) val))))))
(defun env-override (cfg) (defun env-override (cfg)
(hash-to-slots (env-data cfg) cfg (env-slots cfg))) (hash-to-slots (env-data *root*) cfg (env-slots cfg)))

View file

@ -18,7 +18,7 @@
(load (t:test-path "config-web" "etc")) (load (t:test-path "config-web" "etc"))
(unwind-protect (unwind-protect
(progn (progn
(core:setup-services config:*root*) (core:setup-services)
(let ((server (core:find-service :server)) (let ((server (core:find-service :server))
(client (core:find-service :client))) (client (core:find-service :client)))
(test-server-config server) (test-server-config server)