 define ["jquery"],($)->
 
   class Lock
-    constructor:->
+    constructor:(@accept_logs=false)->
       @_locks = {}
-      @initialize.apply this, arguments
-
-    initialize:->
-      #for overwrite
 
     trylock:(url, name)->
       key = @hash url, name
       if !!@_locks[key]
+        console.warn "tryLock #{url} #{name}" if @accept_logs
         false
       else
         @_locks[key] = true

      options or options = {}
      options.type = "POST"
      @ajax options

      options.stub = null
      $.ajax(options)
        .done (data)->
          if not data or data.result is "error"
            async.reject data
          else
            async.resolve data

        .fail (err)->
          async.reject err
        .always =>
