コード例 #1
0
        private static void ReindexerBindingUnloading()
        {
            try
            {
                ReindexerEmbedded.DisableLogger();

                _bufferGcCancelToken.Cancel();
                _bufferGc.Join();

                //to unlock file.
                if (PlatformSpecificFreeLibrary(NativeLibraryAddr))
                {
                    DebugHelper.Log($"The native library is unloaded successfully.");
                }
                else
                {
                    DebugHelper.Log($"The native library couldn't unload.");
                }

                NativeLibraryAddr = default;
            }
            catch (Exception ex)
            {
                DebugHelper.Log(ex.Message);
            }
        }
コード例 #2
0
        public virtual async Task InitAsync()
        {
            DbPath = Path.Combine(Path.GetTempPath(), "ReindexerEmbedded", TestContext.TestName, Storage.ToString());
            if (Directory.Exists(DbPath))
            {
                Directory.Delete(DbPath, true);
            }
            Client = new ReindexerEmbedded();
            ReindexerEmbedded.EnableLogger(Log);
            await Client.ConnectAsync(DbPath, new ConnectionOptions { Storage = Storage });

            await Client.OpenNamespaceAsync(NsName);

            await Client.TruncateNamespaceAsync(NsName);
        }