开启sqlite wal模式

dev2.0
陈伟 2025-04-23 15:20:37 +08:00
parent 22afd52378
commit c6de7d19a1
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ namespace Hopetry.Provider
{ {
return new SqlSugarClient(new ConnectionConfig() return new SqlSugarClient(new ConnectionConfig()
{ {
ConnectionString = @"DataSource=minio.db", // 数据库路径 ConnectionString = @"DataSource=minio.db;Journal Mode=WAL;", // 数据库路径
DbType = DbType.Sqlite, // 数据库类型 DbType = DbType.Sqlite, // 数据库类型
IsAutoCloseConnection = true, // 自动释放 IsAutoCloseConnection = true, // 自动释放
InitKeyType = InitKeyType.Attribute // 从实体特性中读取主键信息 InitKeyType = InitKeyType.Attribute // 从实体特性中读取主键信息

View File

@ -360,7 +360,7 @@ public class DownViewModel : MvcViewModelBase
{ {
var task = new MinioDownloadTask(_minioService, bucketName, objectKey, downDir, size); var task = new MinioDownloadTask(_minioService, bucketName, objectKey, downDir, size);
using var client = SqlSugarConfig.GetSqlSugarScope(); using var client = SqlSugarConfig.GetSqlSugarScope();
//todo 文件总字节数 //todo 锁库问题 下载多线程冲突
client.Insertable(task).ExecuteCommandIdentityIntoEntity(); client.Insertable(task).ExecuteCommandIdentityIntoEntity();
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {