Compare commits

..

1 Commits

Author SHA1 Message Date
7218f309de
WIP: feat: cancel git clone ops gracefully
Some checks failed
continuous-integration/drone/push Build is failing
See #528
2025-04-22 20:11:56 +02:00
2 changed files with 5 additions and 3 deletions

View File

@ -75,6 +75,7 @@ func Clone(dir, url string) error {
log.Debugf("git clone: %s already exists", dir)
}
fmt.Println("FOOOOO")
close(waitCh)
}()

View File

@ -12,8 +12,11 @@ import (
)
func TestCancelGitClone(t *testing.T) {
dir := path.Join(config.RECIPES_DIR, "gitea")
os.RemoveAll(dir)
go func() {
time.Sleep(time.Second * 1)
time.Sleep(1 * time.Second)
p, err := os.FindProcess(os.Getpid())
if err != nil {
@ -24,8 +27,6 @@ func TestCancelGitClone(t *testing.T) {
}()
gitURL := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, "gitea")
dir := path.Join(config.RECIPES_DIR, "gitea")
if err := Clone(dir, gitURL); err == nil {
t.Fatal("cloning should have been interrupted")
}