static void Main(string[] args)
        {
            using (Deserializer deserilaizer = new Deserializer())
            {
                var _file = Directory.GetCurrentDirectory() + @"\Config.ini";

                deserilaizer.Execute(_file);

                kcopyConfigs = deserilaizer.GetTag("kcopy");

                kirokuConfigs = deserilaizer.GetTag("kiroku");
            }

            if (KCopyManager.Initialize(kcopyConfigs, kirokuConfigs))
            {
                Console.WriteLine($"Configs loaded.");
                if (KCopyManager.Execute())
                {
                    Console.WriteLine($"KCopy executed.");
                }
                else
                {
                    Console.WriteLine($"KCopy failed.");
                }
            }
            else
            {
                Console.WriteLine($"Configs failed.");
            }

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("\n\tDEBUG DETECTED, PRESS ANY KEY");
            Console.ReadKey();
        }
Beispiel #2
0
        /// <summary>
        /// Sort and set application and logging configs from package.
        /// </summary>
        /// <returns></returns>
        private static bool SetAppConfig()
        {
            var kqueryInt = KQueryManger.Initialize(KQueryAppCfg, KQueryKLogCfg);

            var kcopyInt = KCopyManager.Initialize(KCopyAppCfg, KCopyKLogCfg);

            var kloadInt = KLoadManager.Initialize(KLoadAppCfg, KLoadKLogCfg);

            return(kqueryInt && kcopyInt && kloadInt);
        }
        public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log)
        {
            log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
            log.LogInformation($"Config Status: {Configuration.ConfigStatus("KCopyApp")}");

            try
            {
                var result = KCopyManager.Execute();

                log.LogInformation($"KCopy Result: {result}");
            }
            catch (Exception ex)
            {
                log.LogInformation($"KCopy Exception: {ex.ToString()}");
            }
        }