INNER CODE UNIT · Go

ticker

andrearaponi/dito · config/config.go:303

	ticker := time.NewTicker(2 * time.Second)
	defer ticker.Stop()

	for {
		select {
		case <-ticker.C:
			fileInfo, err := os.Stat(configFile)
			if err != nil {
				logger.Error(fmt.Sprintf("Error statting configuration file: %v", err))
				continue
			}

			if fileInfo.ModTime().After(lastModified) {
				// Wait a bit to ensure file write is complete
				time.Sleep(1 * time.Second)

				newConfig, err := LoadConfiguration(configFile)
				if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…