alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

dashboard widget action on database #142

Open skalimer0 opened 2 years ago

skalimer0 commented 2 years ago

Hello,

I try to create a widget who compute time's issues (from issue's status change) and insert them in the database for the current user.

But if i used a widget on a dashboard to to that : the job is done 4 times (perhaps because the server use 4 workers PUMA to run the server... i don't know...)

So, in database i have 4 inserts for the same time's issue, but the widget is present just one time in my dashboard and display my charts.

Can you help my to understand why my helper methods is call several times ?

In debug on my computer i don't have any problem.

Thanks a lot.

skalimer0 commented 2 years ago

I solve the problem with Mutex and synchronize method, but it's destabilizing to have multi execution for all my widgets by all the workers.

skalimer0 commented 2 years ago

One more thing, if i update settings, the widget (and the helper) is call just one time. The problem is only on dashboard's display.