Skip to content

Commit

Permalink
#1408: Fixes collection modified error when cleaning up sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
Badgerati committed Oct 21, 2024
1 parent 860aa58 commit d2d6a00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Private/Sessions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function Set-PodeSessionInMemClearDown {

# remove sessions that have expired, or where the parent is gone
$now = [DateTime]::UtcNow
foreach ($key in $store.Memory.Keys) {
foreach ($key in $store.Memory.Keys.Clone()) {
# expired
if ($store.Memory[$key].Expiry -lt $now) {
$null = $store.Memory.Remove($key)
Expand Down

0 comments on commit d2d6a00

Please sign in to comment.