Skip to content

Instantly share code, notes, and snippets.

@bbbates
Last active January 2, 2016 01:28
Show Gist options
  • Save bbbates/8230170 to your computer and use it in GitHub Desktop.
Save bbbates/8230170 to your computer and use it in GitHub Desktop.
Enabling scheduling on a single node with Confijulate
(ns
^:cfj-config
my-app.config
(:require [confijulate.core :as cfj]))
(def ^:cfj-base base-config
{
:jobs
{:enable-schedule false} ;;disabled by default
}
)
(ns my-app.scheduler
(:use [confijulate.core :only [get-cfg])
(:require [clojurewerkz.quartzite.scheduler :as qs]))
(defn initialise
"The initialisation function for the scheduling system"
[]
(when (get-cfg :jobs :enable-schedule)
(qs/start)))
;; Use the -Dcfj.jobs.enable-schedule=true command line arg to switch the scheduler on for a node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment