Skip to content

Instantly share code, notes, and snippets.

@drewr
Created December 10, 2009 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewr/253711 to your computer and use it in GitHub Desktop.
Save drewr/253711 to your computer and use it in GitHub Desktop.
(defn make-task [job id]
(let [f (fn [context]
(try
((job :task) job)
(catch Exception e
(log/error (format "%s %s" (job :name) e))
(mail-error job e))))]
(proxy [Task] []
(execute [context] (f context)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment