<commit_before>// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris

package main

import (
	"log"
	"os"
	"syscall"
	"time"
)

func terminateGracefully(process *os.Process) {
	// If enabled, attempt to do a graceful shutdown of the child process.
	done := make(chan error, 1)
	go func() {
		log.Println(okColor("Gracefully stopping the current process.."))
		if err := process.Signal(syscall.SIGTERM); err != nil {
			done <- err
			return
		}
		_, err := process.Wait()
		done <- err
	}()

	select {
	case <-time.After(3 * time.Second):
		log.Println(failColor("Could not gracefully stop the current process, proceeding to hard stop."))
		if err := process.Kill(); err != nil {
			log.Fatal(failColor("Could not kill child process. Aborting due to danger of infinite forks."))
		}
		<-done
	case err := <-done:
		if err != nil {
			log.Fatal(failColor("Could not kill child process. Aborting due to danger of infinite forks."))
		}
	}
}
<commit_msg>Removed spurious comment leftover from implementation of graceful termination in the daemon.go file<commit_after>// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris

package main

import (
	"log"
	"os"
	"syscall"
	"time"
)

func terminateGracefully(process *os.Process) {
	done := make(chan error, 1)
	go func() {
		log.Println(okColor("Gracefully stopping the current process.."))
		if err := process.Signal(syscall.SIGTERM); err != nil {
			done <- err
			return
		}
		_, err := process.Wait()
		done <- err
	}()

	select {
	case <-time.After(3 * time.Second):
		log.Println(failColor("Could not gracefully stop the current process, proceeding to hard stop."))
		if err := process.Kill(); err != nil {
			log.Fatal(failColor("Could not kill child process. Aborting due to danger of infinite forks."))
		}
		<-done
	case err := <-done:
		if err != nil {
			log.Fatal(failColor("Could not kill child process. Aborting due to danger of infinite forks."))
		}
	}
}

{'fraction_non_alphanumeric': 0.12692702980472764, 'fraction_numerical': 0.0020554984583761563, 'mean_word_length': 3.6467780429594274, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2047111', 'n_tokens_mistral': 712, 'n_tokens_neox': 622, 'n_words': 212}