Browse Source

Move `assoc-val` helper method to `main.rkt`

master
Bonface Munyoki 2 years ago
parent
commit
e7e8f931cf
Signed by: bonfacemunyoki GPG Key ID: F5BBAE1E0392253F
  1. 4
      examples/polling-server.rkt
  2. 6
      main.rkt

4
examples/polling-server.rkt

@ -6,7 +6,7 @@
feedanalyser)
;; Conf parameters
o;; Conf parameters
(define conf-filepath (make-parameter #f))
(define redis-conf (make-parameter '((host . "127.0.0.1")
(port . 6379)
@ -27,8 +27,6 @@
#:args () (void)))
(define (assoc-val key assoc-list)
(cdr (assoc key assoc-list)))
(cond
[(conf-filepath)
(let [(server/settings

6
main.rkt

@ -15,9 +15,13 @@
redis)
(provide load-config)
(provide load-config
assoc-val)
(define (assoc-val key assoc-list)
(cdr (assoc key assoc-list)))
;; Example (load-config "/tmp/conf.rkt")
(define (load-config config-path)
(with-handlers ([exn:fail:filesystem:errno?

Loading…
Cancel
Save