Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add missing upsert

  • Loading branch information...
commit 0e363203b542835cf3637b0b3c4e258a2ad6b68f 1 parent 5fc577c
@marvinthepa authored
Showing with 5 additions and 5 deletions.
  1. +2 −1  project.clj
  2. +3 −4 src/hackbrett/mapping.clj
View
3  project.clj
@@ -12,7 +12,8 @@
[congomongo "0.1.9"]
[com.eaio.uuid/uuid "3.3"]
]
- :repositories {"eaio.com" "http://eaio.com/maven2"}
+ :repositories {"eaio.com" "http://eaio.com/maven2"
+ "stuartsierra-releases" "http://stuartsierra.com/maven2"}
:dev-dependencies [[org.clojars.scott/lein-nailgun "1.1.0"]
[vimclojure/server "2.3.1"]
[ring-mock "0.1.2"]
View
7 src/hackbrett/mapping.clj
@@ -1,6 +1,5 @@
(ns hackbrett.mapping
- (:use hackbrett.util
- clojure.pprint
+ (:use clojure.pprint
[clojure.tools.logging :only [error]]
[clojure.java.io :only [copy output-stream delete-file]]
[somnium.congomongo :as mongo]
@@ -58,8 +57,8 @@
{old-path :real-filename} (mongo/fetch-and-modify
:samples
{:id-filename filename}
- {:id-filename filename, :real-filename path})]
- (when (not= old-path path)
+ {:id-filename filename, :real-filename path} :upsert? true)]
+ (when (and old-path (not= old-path path))
(delete-file old-path true))
path))
Please sign in to comment.
Something went wrong with that request. Please try again.