prometheus-community / windows_exporter

Prometheus exporter for Windows machines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with scheduled_task

mattdurham opened this issue · comments

The scheduled_task returns CO_E_NOTINITIALIZED when I try to use it. I think it is getting initialized in build but then uninited. if I remove this line https://github.com/prometheus-community/windows_exporter/blob/master/pkg/collector/scheduled_task/scheduled_task.go#L130 it works as expected.

CoUninitialize should be called on application shutdown, as the last call made to the COM library after the application hides its main windows and falls through its main message loop.

https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-couninitialize