                        :content      content
                        :content_type content-type}
                       {:connection tx}))
-    (-schedule-paste-expiry db-spec expires (t/now))
+    (-schedule-paste-expiry db-spec expires)
     id))
 
 


(defn- -schedule-paste-expiry
  "Schedule the expired paste cleanup to run."
  [db-spec expires now]
  (chime-at [expires]
            (fn [_]
              ; Intentionally drop the `:connection` key to avoid stale
              ; connections later.
              (delete-expired-pastes! (dissoc db-spec :connection) now))))


(defquery -unexpired-pastes "sql/unexpired_pastes.sql")

  [db-spec now]
  (j/with-db-transaction [tx db-spec]
    (doseq [p (-unexpired-pastes {:now (to-sql-time now)} {:connection tx})]
      (-schedule-paste-expiry db-spec (-> :expires p from-long)))))


(defquery -create-paste! "sql/create_paste.sql")
