Example #1
0
            internal TaskControllerItem(Source source,
                                        TaskRunGeneric task, TimeSpan runEveryTimeSpan, bool startNow)
            {
                _source           = source;
                _task             = task;
                _runEveryTimeSpan = runEveryTimeSpan;
                _lastRunDateTime  = startNow ? DateTime.MinValue : DateTime.Now;
                _systemStatus     = new SystemStatus(task.Name);

                using (var connection = new MySqlConnection(OTHubSettings.Instance.MariaDB.ConnectionString))
                {
                    _systemStatus.InsertOrUpdate(connection, null, NextRunDate, false, _task.ParentName).GetAwaiter().GetResult();
                }
            }
Example #2
0
            internal TaskControllerItem(BlockchainType blockchain, BlockchainNetwork network, Source source,
                                        TaskRunBlockchain task, TimeSpan runEveryTimeSpan, bool startNow, int blockchainID)
            {
                _blockchain       = blockchain;
                _network          = network;
                _source           = source;
                _task             = task;
                _runEveryTimeSpan = runEveryTimeSpan;
                _lastRunDateTime  = startNow ? DateTime.MinValue : DateTime.Now;
                _systemStatus     = new SystemStatus(task.Name, blockchainID);

                using (var connection = new MySqlConnection(OTHubSettings.Instance.MariaDB.ConnectionString))
                {
                    _systemStatus.InsertOrUpdate(connection, null, NextRunDate, false, _task.ParentName).GetAwaiter().GetResult();
                }

                task.BlockchainStartup(blockchainID, blockchain, network);
            }