Fix crash on background checks on perf data cache

This commit is contained in:
Lord Hepipud 2020-10-01 16:45:39 +02:00
parent 8a99b1761f
commit 744e21b2c7
2 changed files with 2 additions and 1 deletions

View file

@ -15,6 +15,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#127](https://github.com/Icinga/icinga-powershell-framework/issues/127) Fixes wrong error message on failed MSSQL connection due to database not reachable by using `-IntegratedSecurity` * [#127](https://github.com/Icinga/icinga-powershell-framework/issues/127) Fixes wrong error message on failed MSSQL connection due to database not reachable by using `-IntegratedSecurity`
* [#128](https://github.com/Icinga/icinga-powershell-framework/issues/128) Fixes unhandled output from loading `System.Reflection.Assembly` which can cause weird side effects for plugin outputs * [#128](https://github.com/Icinga/icinga-powershell-framework/issues/128) Fixes unhandled output from loading `System.Reflection.Assembly` which can cause weird side effects for plugin outputs
* [#130](https://github.com/Icinga/icinga-powershell-framework/issues/130) Fix crash while running services as background task to collect metrics over time by missing Performance Counter cache initialisation
## 1.2.0 (2020-08-28) ## 1.2.0 (2020-08-28)

View file

@ -43,7 +43,6 @@ function Use-Icinga()
'DebugMode' = $DebugMode; 'DebugMode' = $DebugMode;
} }
); );
New-IcingaPerformanceCounterCache;
} else { } else {
# This will fix the debug mode in case we are only using Libs # This will fix the debug mode in case we are only using Libs
# without any other variable content and daemon handling # without any other variable content and daemon handling
@ -57,6 +56,7 @@ function Use-Icinga()
$global:IcingaDaemonData.FrameworkRunningAsDaemon = $Daemon; $global:IcingaDaemonData.FrameworkRunningAsDaemon = $Daemon;
} }
} }
New-IcingaPerformanceCounterCache;
# Enable DebugMode in case it is enabled in our config # Enable DebugMode in case it is enabled in our config
if (Get-IcingaFrameworkDebugMode) { if (Get-IcingaFrameworkDebugMode) {