Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 23e8ae04

Přidáno uživatelem Alex Konig před více než 3 roky(ů)

re #9036 Edits to be able to survive wrong inputs

Zobrazit rozdíly:

Server/ServerApp/Parser/Parsers/LogInParser.cs
43 43
        {
44 44
            List<ActivityInfo> list = new List<ActivityInfo>();
45 45

  
46
            if (loginFiles == null || startTime == null || endTime == null || interval <= 0)
46
            if (loginFiles == null || interval <= 0)
47 47
                return list;
48 48

  
49
            // for all files in folder
50
            foreach (string fileName in loginFiles)
49
            string current = "";
50
            try
51 51
            {
52
                if (!File.Exists(fileName))
53
                    continue;
54
                
55
                // parse as one instance per day
56
                List<ActivityInfo> loadedData = null;
57
                if (wholeDay)
58
                    loadedData = ProcessOneLogInFileAsDays(fileName, startTime, endTime);
59
                // parse by interval length
60
                else
61
                    loadedData = ProcessOneLoginFileAsIntervals(fileName, interval, startTime, endTime);
52
                // for all files in folder
53
                foreach (string fileName in loginFiles)
54
                {
55
                    current = fileName;
56

  
57
                    if (!File.Exists(fileName))
58
                        continue;
62 59

  
63
                list.AddRange(loadedData);
60
                    // parse as one instance per day
61
                    List<ActivityInfo> loadedData = null;
62
                    if (wholeDay)
63
                        loadedData = ProcessOneLogInFileAsDays(fileName, startTime, endTime);
64
                    // parse by interval length
65
                    else
66
                        loadedData = ProcessOneLoginFileAsIntervals(fileName, interval, startTime, endTime);
67

  
68
                    list.AddRange(loadedData);
69
                }
70
            } catch
71
            {
72
                Console.WriteLine("Incorrect Login input file " + current);
64 73
            }
65 74

  
66 75
            return list;

Také k dispozici: Unified diff