Merge pull request #321 from Icinga:fix/code_cache_creation_loop

Fix: Code cache creation loop

With the previous implementation, we caused an infinite creation of the code cache during every execution, causing Icinga to fail executing checks.
This commit is contained in:
Lord Hepipud 2021-08-07 01:49:26 +02:00 committed by GitHub
commit 6a82bf0baf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,8 +46,6 @@ function Use-Icinga()
Use-IcingaPlugins; Use-IcingaPlugins;
} }
Write-IcingaFrameworkCodeCache;
# This function will allow us to load this entire module including possible # This function will allow us to load this entire module including possible
# actions, making it available within our shell environment # actions, making it available within our shell environment
# First load our custom modules # First load our custom modules
@ -135,7 +133,7 @@ function Import-IcingaLib()
$CacheFile = Get-IcingaFrameworkCodeCacheFile; $CacheFile = Get-IcingaFrameworkCodeCacheFile;
if ($Custom -eq $FALSE -And $CompileCache -eq $FALSE -And (Test-Path $CacheFile)) { if ($CompileCache -eq $FALSE) {
Import-Module 'icinga-powershell-framework' -Global -Force; Import-Module 'icinga-powershell-framework' -Global -Force;
return; return;
} }