(logger LoggerType)
| 135 | } |
| 136 | |
| 137 | func MemoryMonitor(logger LoggerType) { |
| 138 | if !atomic.CompareAndSwapInt32(&memoryMonitorCount, 0, 1) { |
| 139 | return |
| 140 | } |
| 141 | |
| 142 | t := time.NewTicker(1 * time.Second) |
| 143 | |
| 144 | for { |
| 145 | <-t.C |
| 146 | if IsLowMemory() { |
| 147 | TriggerFreeMemory() |
| 148 | } else { |
| 149 | |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func UUIDStrToMySQLHex(u string) string { |
| 155 | return strings.ToUpper(strings.ReplaceAll(u, "-", "")) |
no test coverage detected