Skip to content

Commit aa64e24

Browse files
authored
Merge pull request #16 from raisedapp/develop
Version 0.2.2
2 parents c69d5de + 47f190d commit aa64e24

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

src/main/Hangfire.Storage.SQLite/Hangfire.Storage.SQLite.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
88
</PropertyGroup>
99
<PropertyGroup>
10-
<Version>0.2.1</Version>
10+
<Version>0.2.2</Version>
1111
<Authors>RaisedApp</Authors>
1212
<Company>RaisedApp</Company>
1313
<Copyright>Copyright © 2019 - Present</Copyright>
@@ -20,9 +20,10 @@
2020
<title>Hangfire Storage SQLite</title>
2121
<Description>An Alternative SQLite Storage for Hangfire</Description>
2222
<PackageReleaseNotes>
23-
0.2.1
23+
0.2.2
2424
- Add AutoVacuum Options
2525
- Add ExpireAt In JobParamter And State Models
26+
- Fix pragma sql
2627
</PackageReleaseNotes>
2728
</PropertyGroup>
2829
<ItemGroup>

src/main/Hangfire.Storage.SQLite/HangfireDbContext.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ public void Init(SQLiteStorageOptions storageOptions)
8484
{
8585
StorageOptions = storageOptions;
8686

87+
try
88+
{
89+
Database.Execute($@"PRAGMA auto_vacuum = '{(int)storageOptions.AutoVacuumSelected}'");
90+
}
91+
catch (Exception ex)
92+
{
93+
Logger.Log(LogLevel.Error, () => $"Error set auto vacuum mode. Details: {ex.ToString()}");
94+
}
95+
8796
Database.CreateTable<AggregatedCounter>();
8897
Database.CreateTable<Counter>();
8998
Database.CreateTable<HangfireJob>();
@@ -107,15 +116,6 @@ public void Init(SQLiteStorageOptions storageOptions)
107116
SetRepository = Database.Table<Set>();
108117
StateRepository = Database.Table<State>();
109118
DistributedLockRepository = Database.Table<DistributedLock>();
110-
111-
try
112-
{
113-
Database.Execute($"PRAGMA auto_vacuum = {(int) storageOptions.AutoVacuumSelected};");
114-
}
115-
catch (Exception ex)
116-
{
117-
Logger.Log(LogLevel.Error, () => $"Error set auto vacuum mode. Details: {ex.ToString()}");
118-
}
119119
}
120120

121121
public TableQuery<AggregatedCounter> AggregatedCounterRepository { get; private set; }

src/test/Hangfire.Storage.SQLite.Test/Hangfire.Storage.SQLite.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<PackageReference Include="xunit" Version="2.4.0" />
1919
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
2020
<PackageReference Include="coverlet.collector" Version="1.0.1" />
21+
<PackageReference Include="Xunit.SkippableFact" Version="1.3.12" />
2122
</ItemGroup>
2223

2324
<ItemGroup>

src/test/Hangfire.Storage.SQLite.Test/SQLiteDistributedLockFacts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void Ctor_WaitForLock_OnlySingleLockCanBeAcquired()
144144
manualResetEvent.Wait();
145145

146146
// Attempt to acquire the distributed lock.
147-
using (new SQLiteDistributedLock("resource1", TimeSpan.FromSeconds(5), connection, new SQLiteStorageOptions()))
147+
using (new SQLiteDistributedLock("resource1", TimeSpan.FromSeconds(10), connection, new SQLiteStorageOptions()))
148148
{
149149
// Find out if any other threads managed to acquire the lock.
150150
var oldConcurrencyCounter = Interlocked.CompareExchange(ref concurrencyCounter, 1, 0);

0 commit comments

Comments
 (0)