Improve reliability and quality of the system
namespace #1
|
@ -34,11 +34,6 @@
|
|||
(yaml/parse-stream datafile))
|
||||
(catch Exception e nil)))
|
||||
|
||||
(defn system []
|
||||
{:config nil
|
||||
:state nil
|
||||
:irc nil})
|
||||
|
||||
(defn start [system]
|
||||
sm2n marked this conversation as resolved
Outdated
|
||||
(let [config (load-config "config.yaml")
|
||||
state (atom (load-state (:data-file config)))
|
||||
|
@ -58,7 +53,7 @@
|
|||
(defn restart [system-var]
|
||||
(do
|
||||
(alter-var-root system-var stop)
|
||||
(alter-var-root system-var (constantly system))
|
||||
(alter-var-root system-var (constantly nil))
|
||||
sm2n marked this conversation as resolved
Outdated
sm2n
commented
No reason for this either, I think? As the system value isn't used for No reason for this either, I think? As the system value isn't used for `start`, and running `stop` multiple times is safe.
seabass
commented
I've just made commit I've just made commit 91cbdb69da - is this what you had in mind?
|
||||
(alter-var-root system-var start)))
|
||||
|
||||
(defn -main [& args]
|
||||
|
|
Loading…
Reference in New Issue
start
doesn't actually use its input as far as I can tell? I think it'd be better to use _ as the binding name here since that is the case.I was imagining that, in the future, this could be used to pass custom options to a single instance for development purposes, and also eventually for the main function to read the config and pass it in rather than
system/start
doing it by itself. Do you have any preference here? For now, yes, I agree it would be better to use_
as the binding name.No, I don't have a preference here. I think what you said makes sense with regards to custom options etc. Feel free to mark this resolved.
Resolved in commit
91cbdb69da
.