 (defn -main [db-uri]
   (log/merge-config! {:level :info
                       :output-fn (partial log/default-output-fn {:stacktrace-fonts {}})})
+  (log/info "Starting the slackbot with" db-uri)
   (let [scheduler (scheduler/start (scheduler/initialize))
         db-conn (d/connect db-uri)]
     (init-start-jobs scheduler db-conn)

               (connect token))]
    (if conn
      ;; TODO in parallell, but the job is not finished before all has answered/timeout
      (do (doseq [user users]
            (let [answers (send-questionnaire conn user (sort-by :question/order questions))]
              (submit-answers db-conn domain user answers)))
          ((:shutdown-fn conn)))
      (do (println "Nothing to do")
          (println "Token" token) ;; TODO proper logging!
          (println "Users" users)
          (println "Questions" questions)))))

(defn schedule-questionnaire-job [scheduler db-conn domain cron-string]
  (let [job (jobs/build

              :answer/text (:answer answer)
              :answer/ts (:ts answer)
              :question/_answers (:question-id answer)})]
    @(d/transact db-conn tx)
    (log/infof "Successfully Submitted % answers to %s for %s" (count answers) domain user)))

(defjob QuestionnaireJob [job-data]
  (let [{:strs [domain db-conn]} (conversion/from-job-data job-data)
        _ (log/info "Scheduled job started for" domain)
        db (d/db db-conn)
        token (:team/token (d/entity db [:team/domain domain]))
        users (d/q '[:find [?name ...]
