Reset Endpoints

Hey again :sweat_smile:

Do you have a way to reset all endpoint , I explain yesterday i do a Dashboard with an Endpoint who create a files in a folder for the test, I scheldue it and work great, so I stop the Dashboard and delete the script “test.ps1” but the endpoint from “test.ps1” work again today and I have restart my computer.
This is a bug or I need to do something for stop it ?

I need your help because that broke my main Dashboard :cry:

I have a similar behavior.
When I’m writing/testing a dashboard with -autoreload I noticed I have to restart my Visual Code from time to time because I have strange behaviors.
I started analyzing what could be the cause and noticed I have lots of Endpoints after a while:

PS5  C:\Dev\UD> $ud.DashboardService.EndpointService.Endpoints.count
100
PS5 C:\Dev\UD> $ud.DashboardService.EndpointService.Endpoints.count
106

Each time I save my dashboard, the number is increased with the same amount.

Is there a way to clear these endpoints? During Autoreload or manually triggered?

This is a known issue. It’s actually in my plan to fix today!

To work around this you can call: $ud.DashboardService.EndpointService.Endpoints.Clear()

when stopping your dashboard. If you’re using auto-reload. Try putting it in the beginning of your script. Something like:

$Dashboard = Get-UDDashboard
if ($null -ne $Dashboard)
{
     $Dashboard.DashboardService.EndpointService.Endpoints.Clear() 
}

Here’s the issue covering it.

Thanks a lot Adam.
This workaround suits me perfect.

Just run $Dashboard.DashboardService.EndpointService.Endpoints.Count
and the result was 3695 endpoints,

The result of building UniversalDashboard.Antd Module + UDAntd website :grin:

1 Like