Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 19c2a5c4

Přidáno uživatelem Pultak před asi 2 roky(ů)

re #9568 Fixed a typo in the config file

Zobrazit rozdíly:

ld_client/LDClient/appsettings.json
26 26
    "CacheFileName": "cache"
27 27
  },
28 28
  "DebuggerDetection": {
29
    "F32RemArguments" : [
29
    "F32RemArguments": [
30 30
      "localhost port=20000 printer.filetype ASCIIE",
31
      "localhost port=20000 printer.open C:\\Users\\pulta\\Desktop\\testResult.txt",
31
      "localhost port=20000 printer.open C:\\app\\result.txt",
32 32
      "localhost port=20000 WinPrint.version.hardware",
33
      "localhost port=20000 printer.close"
33
      "localhost port=20000 printer.close "
34 34
    ],
35
    "F32RemExecutable": "/home/silhavyj/School/KIV-ASWI/aswi2022bug-thugs/ld_client/Mock/t32rem/build/t32rem_mock",
36
    "T32ProcessName": "ld_mock",
37
    "T32InfoLocation": "C:\\Users\\pulta\\Desktop\\testResult.txt",
35
    "F32RemExecutable": "c:\\app\\tools\\T32\\bin\\windows64\\t32rem.exe",
36
    "T32ProcessName": "t32mtc",
37
    "T32InfoLocation": "C:\\app\\result.txt",
38 38
    "DetectionPeriod": 5000,
39 39
    "FetchInfoMaxAttempts": 5,
40 40
    "FetchInfoAttemptPeriod": 1000,
ld_client/LDClient/detection/InfoFetcher.cs
1 1
using System.Diagnostics;
2
using LDClient.utils.loggers;
2 3

  
3 4
namespace LDClient.detection {
4 5

  
......
71 72
                t32RemProcess.StartInfo.Arguments = argument;
72 73
                try {
73 74
                    t32RemProcess.Start();
74
                    t32RemProcess.WaitForExit(waitTimeoutMs);
75
                    if (!t32RemProcess.WaitForExit(waitTimeoutMs)) {
76
                        Program.DefaultLogger.Error($"Execution has not terminated within a predefined timeout of {waitTimeoutMs} ms");
77
                        return false;
78
                    }
75 79
                    if (t32RemProcess.ExitCode != successExitCode) {
80
                        Program.DefaultLogger.Error($"Execution terminated with an error code of {t32RemProcess.ExitCode}");
76 81
                        return false;
77 82
                    }
78 83
                } catch (Exception exception) {
ld_client/LDClient/utils/ConfigLoader.cs
117 117
                FetchInfoAttemptPeriod = uint.Parse(debugger["FetchInfoAttemptPeriod"]);
118 118
                T32RemSuccessExitCode = int.Parse(debugger["T32RemSuccessExitCode"]);
119 119
                T32RemWaitTimeoutMs = int.Parse(debugger["T32RemWaitTimeoutMs"]);
120
                F32RemArguments = configuration.GetSection($"{DdSection}:F32RemCommands").GetChildren().Select(key => key.Value).ToArray();
120
                F32RemArguments = configuration.GetSection($"{DdSection}:F32RemArguments").GetChildren().Select(key => key.Value).ToArray();
121 121
            } catch (Exception e) {
122 122
                Console.WriteLine(e);
123 123
                Environment.Exit(ErrorExitCode);

Také k dispozici: Unified diff