Simplify the system start and restart functions
This commit changes the binding name of system/start's argument to _ (since it is currently not used within the function), and simplifies the system/restart function by not swapping the system Var's content with nil before filling it with the new-created system state. Eventually, these changes will be reverted when the initialisation of the system is separated from the starting of that system, which will mean that system/start will read its argument and that system/restart will have to reinitialise the system state before restarting it. Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
parent
fecd09c656
commit
91cbdb69da
|
@ -34,7 +34,7 @@
|
|||
(yaml/parse-stream datafile))
|
||||
(catch Exception e nil)))
|
||||
|
||||
(defn start [system]
|
||||
(defn start [_]
|
||||
(let [config (load-config "config.yaml")
|
||||
state (atom (load-state (:data-file config)))
|
||||
irc (irc/new-irc-connection state config)]
|
||||
|
@ -52,8 +52,7 @@
|
|||
|
||||
(defn restart [system-var]
|
||||
(do
|
||||
(alter-var-root system-var stop)
|
||||
(alter-var-root system-var (constantly nil))
|
||||
(stop (deref system-var))
|
||||
(alter-var-root system-var start)))
|
||||
|
||||
(defn -main [& args]
|
||||
|
|
Loading…
Reference in New Issue