private void Timer_Elapsed(object sender, ElapsedEventArgs e)
 {
     timer.Stop();
     try
     {
         _marvin.Run();
     }
     catch (Exception ex)
     {
     }
     finally
     {
         timer.Start();
     }
 }
Exemple #2
0
        /// <summary>
        /// A simple function that takes a string and does a ToUpper
        /// </summary>
        /// <param name="input"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public object FunctionHandler(object input, ILambdaContext context)
        {
            LambdaLogger.Log("Starting" + Environment.NewLine);

            AppSettings appSettings = new AppSettings()
            {
                PrivateKey       = GetPrivateKey(),
                Daedric_Address  = Environment.GetEnvironmentVariable("Daedric_Address"),
                Network_Url      = Environment.GetEnvironmentVariable("Network_Url"),
                testTransactions = bool.Parse(Environment.GetEnvironmentVariable("Test_Transactions")),
            };

            var logger = new LoggerConfiguration()
                         .MinimumLevel.Information()
                         .WriteTo.LambdaLoggerSink()
                         .CreateLogger();

            _marvin = new Marvin.Marvin(appSettings, logger);
            _marvin.Run();
            return("OK");
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            try
            {
                var appSettings = GetAppSettings();

                var logger = new LoggerConfiguration()
                             .MinimumLevel.Information()
                             .WriteTo.File(appSettings.LogPath, rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true)
                             .CreateLogger();

                _marvin = new Marvin.Marvin(appSettings, logger, args[0]);
                _marvin.Run();
            }
            catch (Exception ex)
            {
                Log.Error($"Marvin experianced an error while running \n check the log for more detail \n : {ex.Message}");
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }