Skip to content

Commit

Permalink
Cache design document signature in memory
Browse files Browse the repository at this point in the history
Change-Id: I32746b504769fc7f45f2f697b555c3dd802ba60f
  • Loading branch information
avsej committed Apr 4, 2012
1 parent 1e6eb68 commit cd3d933
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/couchbase/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ def self.ensure_design_document!
end
end
doc['signature'] = digest.to_s
current_doc = bucket.design_docs[design_document.to_s]
if current_doc.nil? || current_doc['signature'] != doc['signature']
bucket.save_design_doc(doc)
if doc['signature'] != self.thread_storage[:signature]
self.thread_storage[:signature] = doc['signature']
current_doc = bucket.design_docs[design_document.to_s]
if current_doc.nil? || current_doc['signature'] != doc['signature']
bucket.save_design_doc(doc)
end
end
end

Expand Down

0 comments on commit cd3d933

Please sign in to comment.