Permalink
Browse files

lock at only the collection level for safety for now

  • Loading branch information...
1 parent 734f77f commit ec1d96745bddcd1f38774cc6f1d1e43338774863 freeformz committed Mar 10, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/cloudkit/store.rb
View
@@ -12,11 +12,14 @@ class Store
# FIXME: Move this into the storage adaptor so it works across multiple
# application instances
#
+ # For 'safety' sake we're going to lock at the collection level for now.
+ # FIXME: revisit ^^
+ #
# @param [CloudKit::URI] uri the uri to lock on
# @param [Symbol] operation the operation being performed
def self.transaction(uri, operation)
# generate a unique filename from the uri
- fname = File.join(Dir.tmpdir,".gatekeeper_lock#{uri.current_resource_uri.gsub('/','.')}")
+ fname = File.join(Dir.tmpdir,".gatekeeper_lock.#{uri.components[0]}")
# determine the lock type.
# reads (aka get/head/options) locks are shared so multiple gets can happen at once
# destructive/altering operations (like put, post, delete) are exclusive

0 comments on commit ec1d967

Please sign in to comment.