예제 #1
0
        private void GenerateModelsIfRequested()
        {
            if (Interlocked.Exchange(ref s_req, 0) == 0)
            {
                return;
            }

            // cannot proceed unless we are MainDom
            if (_mainDom.IsMainDom)
            {
                try
                {
                    _logger.LogDebug("Generate models...");
                    _logger.LogInformation("Generate models now.");
                    _modelGenerator.GenerateModels();
                    _mbErrors.Clear();
                    _logger.LogInformation("Generated.");
                }
                catch (TimeoutException)
                {
                    _logger.LogWarning("Timeout, models were NOT generated.");
                }
                catch (Exception e)
                {
                    _mbErrors.Report("Failed to build Live models.", e);
                    _logger.LogError("Failed to generate models.", e);
                }
            }
            else
            {
                // this will only occur if this appdomain was MainDom and it has
                // been released while trying to regenerate models.
                _logger.LogWarning("Cannot generate models while app is shutting down");
            }
        }
        private void GenerateModels()
        {
            try
            {
                if (!_configuration.Enable)
                    return;

                _modelsGenerator.GenerateModels();
            }
            catch(Exception exception)
            {
                Log.Error(exception, "Not able to generate models");
            }
        }
예제 #3
0
 private void GenerateModels()
 {
     // EnableDllModels will recycle the app domain - but this request will end properly
     _modelGenerator.GenerateModels();
 }