func ProcessStuckIncomingMessages() {
	p, err := message.GetPath(message.SectionIncoming, "", "")
	if err != nil {
		return
	}

	// Check all files in the directory
	files, err := ioutil.ReadDir(p)
	if err != nil {
		return
	}

	ticketRepo := container.Instance.GetTicketRepo()
	for _, fileInfo := range files {
		// Not a dir, so not a message
		if !fileInfo.IsDir() {
			continue
		}

		// Find corresponding ticket for this incoming message
		_, err := ticketRepo.Fetch(fileInfo.Name())
		if err != nil {
			logrus.Errorf("found message %s in incoming queue without ticket", fileInfo.Name())

			// @TODO Ticket / message is not found. What to do with the message?
		}

	}
}
// ProcessStuckIncomingMessages will process stuck message found in the incoming queue.
ProcessStuckIncomingMessages will process stuck message found in the incoming queue.
// ProcessStuckIncomingMessages will process stuck message found in the incoming queue .
func ProcessStuckIncomingMessages() {
	p, err := message.GetPath(message.SectionIncoming, "", "")
	if err != nil {
		return
	}
	files, err := ioutil.ReadDir(p)
	if err != nil {
		return
	}
	ticketRepo := container.Instance.GetTicketRepo()
	for _, fileInfo := range files {
		if !fileInfo.IsDir() {
			continue
		}
		_, err := ticketRepo.Fetch(fileInfo.Name())
		if err != nil {
			logrus.Errorf("found message %s in incoming queue without ticket", fileInfo.Name())
		}
	}
}
func ProcessStuckIncomingMessages ( ) { p , err := message . GetPath ( message . SectionIncoming , " " , " " ) if err != nil { return } files , err := ioutil . ReadDir ( p ) if err != nil { return } ticketRepo := container . Instance . GetTicketRepo ( ) for _ , fileInfo := range files { if ! fileInfo . IsDir ( ) { continue } _ , err := ticketRepo . Fetch ( fileInfo . Name ( ) ) if err != nil { logrus . Errorf ( " " , fileInfo . Name ( ) ) } } }
ProcessStuckIncomingMessages will process stuck message found in the incoming queue.
ProcessStuckIncomingMessages will process stuck message found in the incoming queue .
// Check all files in the directory // Not a dir, so not a message // Find corresponding ticket for this incoming message // @TODO Ticket / message is not found. What to do with the message?