MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / parseLogTime

Function parseLogTime

agent/utils/alert/alert.go:543–553  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

541}
542
543func parseLogTime(line string) (time.Time, error) {
544 if len(line) < 15 {
545 return time.Time{}, nil
546 }
547 timeStr := line[:15]
548 parsedTime, err := time.ParseInLocation("Jan 2 15:04:05", timeStr, time.Local)
549 if err != nil {
550 return time.Time{}, nil
551 }
552 return parsedTime.AddDate(time.Now().Year(), 0, 0), nil
553}
554
555func getNodeName(agentInfo *dto.AgentInfo) string {
556 var nodeName string

Callers 2

CountRecentFailedSSHLogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected