Sfoglia il codice sorgente

write to doc collection first

Henry Oswald 11 anni fa
parent
commit
7b0b72494f
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2 3
      services/docstore/app/coffee/DocManager.coffee

+ 2 - 3
services/docstore/app/coffee/DocManager.coffee

@@ -48,11 +48,10 @@ module.exports = DocManager =
 					rev: doc.rev
 				}, "updating doc lines"
 				async.series [
-					(cb)->
-						# project collection is still primary so that needs to be successful first
-						MongoManager.updateDoc project_id, mongoPath, lines, cb
 					(cb)->
 						MongoManager.upsertIntoDocCollection project_id, doc_id, lines, doc.rev, cb
+					(cb)->
+						MongoManager.updateDoc project_id, mongoPath, lines, cb
 				], (error)->
 					return callback(error) if error?
 					callback null, true, doc.rev + 1 # rev will have been incremented in mongo by MongoManager.updateDoc