[Groonga-commit] droonga/fluent-plugin-droonga at e864730 [master] Implement unwatch command

Back to archive index

Yoji Shidara null+****@clear*****
Fri Oct 11 16:55:33 JST 2013


Yoji Shidara	2013-10-11 16:55:33 +0900 (Fri, 11 Oct 2013)

  New Revision: e864730e29e03a8f3eaeb7512abf7705a83caf96
  https://github.com/droonga/fluent-plugin-droonga/commit/e864730e29e03a8f3eaeb7512abf7705a83caf96

  Message:
    Implement unwatch command

  Modified files:
    lib/droonga/plugin/handler_watch.rb

  Modified: lib/droonga/plugin/handler_watch.rb (+14 -1)
===================================================================
--- lib/droonga/plugin/handler_watch.rb    2013-10-11 16:41:09 +0900 (6047bc2)
+++ lib/droonga/plugin/handler_watch.rb    2013-10-11 16:55:33 +0900 (b9ebd7d)
@@ -50,7 +50,20 @@ module Droonga
       # TODO return watch result to client
     end
 
-    # TODO unwatch
+    command "unwatch"
+    def unwatch(request)
+      user, condition, query, route = parse_request(request)
+      query_table = @context['Query']
+      query_record = query_table[query]
+      return unless query_record
+      user_table = @context['User']
+      user_record = user_table[user]
+      return unless user_record
+      subscriptions = user_record.subscriptions.select do |query|
+        query != query_record
+      end
+      user_record.subscriptions = subscriptions
+    end
 
     command "feed"
     def feed(request)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index