 ;##############################################################################
 
 (defn next-trial-for-pull [tx executor]
-  (->> (-> trials-excutors-query-ordered
+  (->> (-> (trials-excutors-query-ordered)
            (sql-merge-where [:= :exs.id (:id executor)])
            (sql-merge-where [:= cider-ci.self/VERSION (:version executor)])
            (sql-limit 1) sql-format)

             (sql-raw (str " repositories.git_url ="
                           " ANY(exs.accepted_repositories) "))])))

(def ^:private trials-excutors-query-ordered
  (-> trials-excutors-base-with-repo
      (sql-order-by [:jobs.priority :desc]
                    [:jobs.created_at :asc]
                    [:tasks.priority :desc]

    [cider-ci.utils.rdbms :as rdbms]
    [clojure.java.jdbc :as jdbc]
    [honeysql.sql :refer :all]
    [cider-ci.utils.config :as config :refer [get-config]]

    [clj-logging-config.log4j :as logging-config]
    [clojure.tools.logging :as logging]
