| 50 | } |
| 51 | |
| 52 | func (pc *PruneController) interactiveDeleteCache(server config.ServerListConfig) bool { |
| 53 | reader := bufio.NewReader(os.Stdin) |
| 54 | for { |
| 55 | fmt.Printf("Are you sure you want to delete this cache? "+ |
| 56 | "Please enter \"yes\" to confirm deletion, or \"no\" to cancel. %s\n"+ |
| 57 | "(yes/no): ", server) |
| 58 | stdin, _ := reader.ReadString('\n') |
| 59 | // Delete space |
| 60 | stdin = strings.TrimSpace(stdin) |
| 61 | switch stdin { |
| 62 | case "yes": |
| 63 | utils.Infof("The cache %v has been marked for deletion.", server) |
| 64 | return true |
| 65 | case "no": |
| 66 | utils.Infof("Cache %v skipped.", server) |
| 67 | return false |
| 68 | default: |
| 69 | utils.Errorln("Input error:", stdin) |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func (pc *PruneController) concurrencyDeleteCache() []config.ServerListConfig { |
| 75 | if pc.concurrency < 1 { |