Пример #1
0
        public static GitHubUpgrader Create(
            ITracer tracer,
            PhysicalFileSystem fileSystem,
            bool dryRun,
            bool noVerify,
            LocalGVFSConfig localConfig,
            out string error)
        {
            GitHubUpgrader       upgrader             = null;
            GitHubUpgraderConfig gitHubUpgraderConfig = new GitHubUpgraderConfig(tracer, localConfig);

            if (!gitHubUpgraderConfig.TryLoad(out error))
            {
                return(null);
            }

            if (gitHubUpgraderConfig.ConfigError())
            {
                gitHubUpgraderConfig.ConfigAlertMessage(out error);
                return(null);
            }

            upgrader = new GitHubUpgrader(
                ProcessHelper.GetCurrentProcessVersion(),
                tracer,
                fileSystem,
                gitHubUpgraderConfig,
                dryRun,
                noVerify);

            return(upgrader);
        }
Пример #2
0
 private void EmitHeartbeat(object unusedState)
 {
     try
     {
         EventMetadata metadata   = this.dataProvider.GetAndResetHeartBeatMetadata(out bool writeToLogFile) ?? new EventMetadata();
         EventLevel    eventLevel = writeToLogFile ? EventLevel.Informational : EventLevel.Verbose;
         DateTime      now        = DateTime.Now;
         metadata.Add("Version", ProcessHelper.GetCurrentProcessVersion());
         metadata.Add("MinutesUptime", (long)(now - this.startTime).TotalMinutes);
         metadata.Add("MinutesSinceLast", (int)(now - this.lastHeartBeatTime).TotalMinutes);
         this.lastHeartBeatTime = now;
         this.tracer.RelatedEvent(eventLevel, "Heartbeat", metadata, Keywords.Telemetry);
     }
     catch (Exception e)
     {
         EventMetadata metadata = new EventMetadata();
         metadata.Add("Area", "HeartbeatThread");
         metadata.Add("Exception", e.ToString());
         this.tracer.RelatedWarning(metadata, "Swallowing unhandled exception in EmitHeartbeat", Keywords.Telemetry);
     }
 }
Пример #3
0
        public static GitHubUpgrader Create(LocalGVFSConfig localConfig, ITracer tracer, out string error)
        {
            GitHubUpgrader       upgrader             = null;
            GitHubUpgraderConfig gitHubUpgraderConfig = new GitHubUpgraderConfig(tracer, localConfig);

            if (!gitHubUpgraderConfig.TryLoad(out error))
            {
                return(null);
            }

            if (gitHubUpgraderConfig.ConfigError())
            {
                gitHubUpgraderConfig.ConfigAlertMessage(out error);
                return(null);
            }

            upgrader = new GitHubUpgrader(
                ProcessHelper.GetCurrentProcessVersion(),
                tracer,
                gitHubUpgraderConfig);

            return(upgrader);
        }
Пример #4
0
 public static string CurrentGVFSVersion()
 {
     return(ProcessHelper.GetCurrentProcessVersion());
 }
Пример #5
0
        public static bool IsDevelopmentVersion()
        {
            Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion());

            return(currentVersion.Major == 0);
        }