Skip to content

Commit

Permalink
Remove timeout on partition waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Feb 19, 2024
1 parent 975ccd6 commit 90a35bb
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions core/disk/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"os"
"slices"
"strings"
"time"

luks "github.com/vanilla-os/albius/core/disk/luks"
"github.com/vanilla-os/albius/core/util"
Expand Down Expand Up @@ -320,8 +319,8 @@ func LUKSSetLabel(part *Partition, name string) error {
// This is particularly useful to make sure a recently created or modified
// partition is recognized by the system.
func (part *Partition) WaitUntilAvailable() {
maxTimeout := 1000
timeout := 0
// maxTimeout := 1000
// timeout := 0

for {
_, err := os.Stat(part.Path)
Expand All @@ -335,12 +334,12 @@ func (part *Partition) WaitUntilAvailable() {
return
}
}
time.Sleep(50 * time.Millisecond)

timeout += 1
if timeout == maxTimeout {
// We can't recover from this, so just panic
panic(fmt.Sprintf("Timed out waiting for partition %s", part.Path))
}
// time.Sleep(50 * time.Millisecond)
//
// timeout += 1
// if timeout == maxTimeout {
// // We can't recover from this, so just panic
// panic(fmt.Sprintf("Timed out waiting for partition %s", part.Path))
// }
}
}

0 comments on commit 90a35bb

Please sign in to comment.