Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created December 4, 2013 16:38
Show Gist options
  • Save jsanda/7790793 to your computer and use it in GitHub Desktop.
Save jsanda/7790793 to your computer and use it in GitHub Desktop.
(ns immutant.init
(:use immutant-demo.core)
(:require [immutant.web :as web]
[immutant.jobs :as jobs]
[rhq.rest.client :as rhq]
[clojure.tools.logging :as logging]))
(web/start ring-handler)
(web/start "/biscuits" another-ring-handler)
(defn get-resource [id]
(:resourceName (:body (rhq/get-resource id))))
(defn fetch-raw-data [rid]
(let [schedules (rhq/get-schedules rid :numeric)]
(doseq [schedule schedules] (rhq/get-raw-data schedule))
(count schedules)))
(jobs/schedule "pull-raw-data"
#(doseq [id [10001 10078 10080 10094
10017 10590 10013 10460
12711 10028 10892 10024]]
(logging/info "Fetching raw data for resource id " id)
(logging/info "Fetched raw data for "
(fetch-raw-data id) " schedules"))
"0 0/5 * 1/1 * ? *")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment