Exemplo n.º 1
0
        private void reorganizeIndexs(IDatabase database, IList <string> tables)
        {
            _logger.Debug("Reorganizing Indexs...");

            foreach (var table in tables)
            {
                _logger.Debug($"Reorganizing Indexs for table '{table}'");
                var indexs = database.GetFragmentedIndexes(table, _reorganizeFragmentationThreshold);

                foreach (var index in indexs)
                {
                    _logger.Information($"Reorganizing Indexs for table '{table}', Index '{index}'");

                    database.ReorganizeIndex(index, table);
                }
            }
        }
Exemplo n.º 2
0
        public async Task InitAsync(CancellationToken ct)
        {
            _logger.Verbose("Preparing to init {windowName} window (id: {windowId}) with url {windowUrl}", Name, Id, Url);
            using (_logger.Timed("Initiating {windowName} window", Name))
            {
                Window = await ElectronNET.API.Electron.WindowManager.CreateWindowAsync(Options, Url);
                await OnCreatedAsync(Window, ct);

                Window.OnClosed += () =>
                {
                    _logger.Debug("Window {windowName} has been closed.", Name);
                    if (_isDisposing)
                    {
                        _logger.Information("Disposing {windowName}. Window wont be recreated", Name);
                        return;
                    }
                    _logger.Information("Recreating window {windowName}", Name);
                    InitAsync(CancellationToken.None).GetAwaiter().GetResult();
                };
            }
        }