Exemple #1
0
        private void RunScripts()
        {
            string version = "unknown";

            try
            {
                version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
            catch (Exception e)
            {
                Logger.Warning("Exception caught reading version number. {0}", e);
            }

            Logger.Info("Starting {0} scripts (version {1}).", this.scriptType, version);
            try
            {
                MetadataJson metadata = MetadataWatcher.GetMetadata();
                this.metadata = reader.GetScripts(metadata);
                this.writer.SetScripts(this.metadata);
            }
            catch (Exception e)
            {
                Logger.Error("Caught top level exception. {0}\r\n{1}", e.Message, e.StackTrace);
            }
            Logger.Info("Finished running {0} scripts.", this.scriptType);
        }
        public void OnStart()
        {
            // Indicate a Windows instance is running.
            PrintAgentStartupJson();

            // Run the work loop until the service shuts down
            MetadataWatcher.UpdateToken(token);
        }