Skip to content

Commit 1428e5c

Browse files
committed
pre9
1 parent 105fab7 commit 1428e5c

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

nuget/pack.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if ($IsMacOS) {
77
$msbuild = join-path $msbuild 'MSBuild\Current\Bin\MSBuild.exe'
88
}
99
$version="2.1.0"
10-
$versionSuffix="-pre8"
10+
$versionSuffix="-preA"
1111

1212
#####################
1313
#Build release config
@@ -17,4 +17,4 @@ del *.nupkg
1717
if ($lastexitcode -ne 0) { exit $lastexitcode; }
1818

1919
nuget push "sqlite-net2.$version$versionSuffix.nupkg" -Source $nugetServer
20-
copy "sqlite-net2.$version$versionSuffix.nupkg" "D:\repos\localnugets"
20+
#copy "sqlite-net2.$version$versionSuffix.nupkg" "D:\repos\localnugets"

src/SQLite.Net/SQLiteConnection.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static SQLiteConnection()
9090
/// </remarks>
9191
public virtual SQLiteConnection Clone()
9292
=> new (DatabasePath, databaseOpenFlags, StoreDateTimeAsTicks, Serializer, _tableMappings, ExtraTypeMappings, Resolver, encryptionKey);
93-
93+
9494
/// <summary>
9595
/// Constructs a new SQLiteConnection and opens a SQLite database specified by databasePath.
9696
/// </summary>
@@ -111,8 +111,13 @@ public virtual SQLiteConnection Clone()
111111
/// <param name="resolver">A contract resovler for resolving interfaces to concreate types during object creation</param>
112112
/// <param name="encryptionKey">When using SQL CIPHER, automatically sets the key (you won't need to override Clone() in this case)</param>
113113
/// <param name="configOption">Mode in which to open the db. Default to Serialized</param>
114+
/// <param name="busyTimeout">
115+
/// Sets a busy handler to sleep the specified amount of time when a table is locked.
116+
/// The handler will sleep multiple times until a total time of busyTimeout has accumulated.
117+
/// Default to 1s
118+
/// </param>
114119
public SQLiteConnection(string databasePath, SQLiteOpenFlags openFlags = SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, bool storeDateTimeAsTicks = true, IBlobSerializer? serializer = null, IDictionary<string, TableMapping>? tableMappings = null,
115-
IDictionary<Type, string>? extraTypeMappings = null, IContractResolver? resolver = null, string? encryptionKey = null, ConfigOption configOption = ConfigOption.Serialized)
120+
IDictionary<Type, string>? extraTypeMappings = null, IContractResolver? resolver = null, string? encryptionKey = null, ConfigOption configOption = ConfigOption.Serialized, TimeSpan? busyTimeout = null)
116121
{
117122
if (string.IsNullOrEmpty(databasePath))
118123
throw new ArgumentException("Must be specified", nameof(databasePath));
@@ -149,7 +154,7 @@ public SQLiteConnection(string databasePath, SQLiteOpenFlags openFlags = SQLiteO
149154
throw new Exception("Invalid cipher key");
150155
}
151156

152-
BusyTimeout = TimeSpan.FromSeconds(0.1);
157+
BusyTimeout = busyTimeout ?? TimeSpan.FromSeconds(1);
153158
Serializer = serializer;
154159
StoreDateTimeAsTicks = storeDateTimeAsTicks;
155160
ExtraTypeMappings = extraTypeMappings ?? new Dictionary<Type, string>();
@@ -179,8 +184,7 @@ public TimeSpan BusyTimeout
179184
set
180185
{
181186
_busyTimeout = value;
182-
if (Handle != null)
183-
sqlite.BusyTimeout(Handle, (int) _busyTimeout.TotalMilliseconds);
187+
sqlite.BusyTimeout(Handle, (int) _busyTimeout.TotalMilliseconds);
184188
}
185189
}
186190

0 commit comments

Comments
 (0)