additionals icon indicating copy to clipboard operation
additionals copied to clipboard

dashboard widget action on database

Open skalimer0 opened this issue 1 year ago • 2 comments

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 avatar Jul 13 '22 13:07 skalimer0

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 avatar Jul 19 '22 05:07 skalimer0

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.

skalimer0 avatar Jul 20 '22 10:07 skalimer0