         fields (if (empty? password)
                  fields
                  (assoc fields :password (bcrypt password)))]
-    (update users
-            (set-fields (assoc fields :salt ""))
-            (where {:user account}))
+    (serialize-task :update-user
+      (update users
+        (set-fields (assoc fields :salt ""))
+        (where {:user account})))
     (ev/record :user (clojure.set/rename-keys fields {:user :username
                                                       :ssh_key :ssh-key
                                                       :pgp_key :pgp-key})))
   (write-key-file (:key-file config)))
 
 (defn add-member [group-id username added-by]
-  (insert groups
-          (values {:name group-id
-                   :user username
-                   :added_by added-by}))
+  (serialize-task :add-member
+    (insert groups
+      (values {:name group-id
+               :user username
+               :added_by added-by})))
   (ev/record :membership {:group-id group-id :username username
                           :added-by added-by}))
 

(defn add-jar [account {:keys [group name version
                               description homepage authors]}]
  (check-and-add-group account group)
  (insert jars
          (values {:group_name group
                   :jar_name   name
                   :version    version
                   :user       account
                   :created    (get-time)
                   :description description
                   :homepage   homepage
                   :authors    (str/join ", " (map #(.replace % "," "")
                                                   authors))})))

            [cemerick.friend.credentials :as creds])
  (:import java.security.MessageDigest
           java.util.Date
           java.io.File
           java.util.concurrent.Executors))

(def ^{:private true} ssh-options
  "no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding")
