Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1361

Setting an observer makes the assets very slow

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.3.3
    • Affects Version/s: None
    • Component/s: None
    • None

      Today, i decided to use observers.

      I created an ActivityObserver and I set it up in config/application.rb :

      config.mongoid.observers = :activity_observer

      And it makes the assets very slow to serve in development mode while navigating in the app.
      Each assets take more than 500ms to load (even if the response is just 304) leading to a page loading time greater than 6s !
      Development navigation becomes impossible.

      I removed the config options, and it became normal (global loading time of 1-2s).
      I set it up again, slow again.

      I use rails 3.1.1 & mongoid 2.3.2.
      And there is the observer :

      1. encoding: utf-8
        class ActivityObserver < Mongoid::Observer
        observe :task, :note

      def after_create(record)
      [...]
      end
      [...]
      end

            Assignee:
            durran Durran Jordan
            Reporter:
            maximeg Maxime Garcia
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: