Skip to content

Commit

Permalink
revert: 🔥 deprecate the garbage collectors (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonhostpi committed Jan 18, 2024
1 parent 4c80051 commit 986dd8b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions Import-Package/Import-Package.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ $mutexes = @{}
New-Item (Join-Path $PSScriptRoot "Packages") -Force -ItemType Directory
New-Item (Join-Path $PSScriptRoot "Temp") -Force -ItemType Directory

& {
# Clear the Cache
Write-Verbose "[Import-Package:Init] Clearing Temp Files..."
Resolve-Path (Join-Path $PSScriptRoot "Temp" "*") | ForEach-Object -Parallel {
$id = $_ | Split-Path -Leaf
[bool] $freed = $false
$m = New-Object System.Threading.Mutex( $false, "Global\ImportPackage-$id", [ref] $freed )
If( $freed ){
Remove-Item $_ -Recurse -ErrorAction Stop
}
$m.Dispose()
} -ThrottleLimit 12 -AsJob | Out-Null
}

. "$PSScriptRoot\src\Resolve-CachedPackage.ps1"
. "$PSScriptRoot\src\Build-PackageData.ps1"

Expand Down Expand Up @@ -184,8 +170,6 @@ function Import-Package {

Process {

$temp_path_generated = $false

$PackageData = Switch( $PSCmdlet.ParameterSetName ){
"Managed-Object" {
Write-Verbose "[Import-Package:ParameterSet] Managed Object"
Expand Down Expand Up @@ -464,14 +448,6 @@ function Import-Package {
} else {
Write-Warning "[Import-Package:Loading] $($PackageData.Name) is not needed for $( $bootstrapper.Runtime )`:$($TargetFramework.GetShortFolderName())"
}

If( $temp_path_generated -and (Test-Path $TempPath) ){
If( Test-Path (Join-Path $TempPath "*") ){
Write-Verbose "[Import-Package:Loading] Temp files: $TempPath"
} Else {
Remove-Item -Path $TempPath -ErrorAction Stop
}
}
}
}
<#
Expand Down

0 comments on commit 986dd8b

Please sign in to comment.