Esempio n. 1
0
        private static void actionsStartAsync()
        {
            Logger.Trace("Start ActionsStartAsync()");
            try
            {
                while (ExchangeData.TryDequeue(out SandboxDataValue ssd))
                {
                    Logger.Trace("Dequeue", ssd.TheType);


                    if (ssd.Value.StorageAction != StorageActionType.None)
                    {
                        DataDispetcherClass.Execution(ssd);
                    }

                    Logger.Debug("Start Action", ssd.TheType);
                    ActionDispetcherClass.Action(ssd);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
            Logger.Trace("Exit ActionsStartAsync()");
        }
Esempio n. 2
0
        private static bool internalStart()
        {
            Logger.Trace("start InternalStart");
            var ret = false;


            ret  = ConfigDispetcherClass.Start();
            ret &= PluginDispetcherClass.Start();
            ret &= DataDispetcherClass.Start();
            ret &= ActionDispetcherClass.Start();

            Logger.Debug("end InternalStart", ret);
            return(ret);
        }
Esempio n. 3
0
        internal CoreLoader(ILogger logger)
        {
            Logger = logger;
            Logger.Trace("Start constructor CoreLoader");
            Logger.Info("Path of execution", _path);
            _fileconfig = Path.Combine(_path, pathconfig, baseconfigname);

            if (File.Exists(_fileconfig))
            {
                _coreConfig = (File.ReadAllText(_fileconfig)).FromJson <CoreConfig>();

                Logger.Info("File with config", _fileconfig);
            }

            if (_coreConfig == null)
            {
                Logger.Warning("File not load with base path", _fileconfig);
                _fileconfig = Path.Combine(_path, defaultpathconfig, baseconfigname);


                if (File.Exists(_fileconfig))
                {
                    _coreConfig = (File.ReadAllText(_fileconfig)).FromJson <CoreConfig>();
                    Logger.Info("File with config", _fileconfig);
                }
            }

            if (_coreConfig == null)
            {
                Logger.Fatal("File not load with base path", _fileconfig);
            }
            else
            {
                Logger.Debug(_coreConfig.ToJson());
                PluginDispetcherClass.Init(_coreConfig.Plugins, _coreConfig.PluginsPath, pathconfig);
                DataDispetcherClass.Init(_coreConfig.StoreSyncroPlugin, _coreConfig.PluginsPath, pathconfig);
                ActionDispetcherClass.ActionConnections = _coreConfig.ActionConnections;
            }
            ConfigDispetcherClass.OnChangeSettings += configDispetcherClass_OnChangeSettings;


            Logger.Debug("End constructor CoreLoader");
        }
Esempio n. 4
0
        static bool plugin_onNeedRestart()
        {
            Logger.Trace("Start Plugin_onNeedRestart");

            var ret = PluginDispetcherClass.IsRestart();

            ret &= DataDispetcherClass.IsRestart();
            if (ret)
            {
                Logger.Info("Reset by 1 second");
                (new Timer(onResetTimer)).Change(1000, 0);
            }
            else
            {
                Logger.Warning("Wait info reset by 3 second");
                (new Timer(onResetNeedTimer)).Change(3000, 0);
            }

            Logger.Trace("End Plugin_onNeedRestart", ret);
            return(ret);
        }