Uploaded image for project: 'Task Management'
  1. Task Management
  2. TASKMGMT-28

Avoid creating User throwaway objects in TaskManager API

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 1.2.2

      Upon logging into AdminCentral, when Pulse initialises, the following method gets called several times
      getTasksAmountByUserAndStatus:192, DefaultTasksManager (info.magnolia.task)
      which, in turn, triggers
      getUser:264, MgnlUserManager (info.magnolia.cms.security).
      This results in the same user instance being created like 10 times.
      Probably not much of a overhead and in any case the instance is local to a method so it will be thrown away immediately, still there could be room for some improvement.

      Could be probably fixed if the TaskMgmt API would pass around the User object instead of just the user id, but that's quite a change on its own. If we passed the User object to TaskManager - we would be able to re-use User from MgnlContext.

        Acceptance criteria

              Unassigned Unassigned
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: