Skip to content

Commit

Permalink
Merge pull request #18 from raisedapp/develop
Browse files Browse the repository at this point in the history
Version 0.2.3
  • Loading branch information
felixclase authored Jan 15, 2020
2 parents aa64e24 + a917882 commit dd64c51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Version>0.2.2</Version>
<Version>0.2.3</Version>
<Authors>RaisedApp</Authors>
<Company>RaisedApp</Company>
<Copyright>Copyright © 2019 - Present</Copyright>
Expand All @@ -20,10 +20,9 @@
<title>Hangfire Storage SQLite</title>
<Description>An Alternative SQLite Storage for Hangfire</Description>
<PackageReleaseNotes>
0.2.2
- Add AutoVacuum Options
- Add ExpireAt In JobParamter And State Models
- Fix pragma sql
0.2.3
- Avoid exception The given key 'X' was not present in the dictionary
- Fix Difference State between State Table and Job Table
</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/main/Hangfire.Storage.SQLite/SQLiteMonitoringApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private JobList<EnqueuedJobDto> EnqueuedJobs(HangfireDbContext connection, IEnum
Job = job,
State = sqlJob.StateName,
EnqueuedAt = sqlJob.StateName == EnqueuedState.StateName
? JobHelper.DeserializeNullableDateTime(stateData["EnqueuedAt"])
? JobHelper.DeserializeNullableDateTime(stateData.ContainsKey("EnqueuedAt") ? stateData["EnqueuedAt"] : string.Empty)
: null
});
}
Expand Down Expand Up @@ -283,7 +283,7 @@ public JobList<DeletedJobDto> DeletedJobs(int from, int count)
(sqlJob, job, stateData) => new DeletedJobDto
{
Job = job,
DeletedAt = JobHelper.DeserializeNullableDateTime(stateData["DeletedAt"])
DeletedAt = JobHelper.DeserializeNullableDateTime(stateData.ContainsKey("DeletedAt") ? stateData["DeletedAt"] : string.Empty)
}));
}

Expand Down Expand Up @@ -360,7 +360,7 @@ public JobList<FailedJobDto> FailedJobs(int from, int count)
ExceptionDetails = stateData["ExceptionDetails"],
ExceptionMessage = stateData["ExceptionMessage"],
ExceptionType = stateData["ExceptionType"],
FailedAt = JobHelper.DeserializeNullableDateTime(stateData["FailedAt"])
FailedAt = JobHelper.DeserializeNullableDateTime(stateData.ContainsKey("FailedAt") ? stateData["FailedAt"] : string.Empty)
}));
}

Expand Down Expand Up @@ -621,7 +621,7 @@ public JobList<SucceededJobDto> SucceededJobs(int from, int count)
TotalDuration = stateData.ContainsKey("PerformanceDuration") && stateData.ContainsKey("Latency")
? (long?)long.Parse(stateData["PerformanceDuration"]) + (long?)long.Parse(stateData["Latency"])
: null,
SucceededAt = JobHelper.DeserializeNullableDateTime(stateData["SucceededAt"])
SucceededAt = JobHelper.DeserializeNullableDateTime(stateData.ContainsKey("SucceededAt") ? stateData["SucceededAt"] : string.Empty)
}));
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ public override void SetJobState(string jobId, IState state)
{
job.StateName = state.Name;
_.Database.BeginTransaction();
_.Database.Insert(new State
{
JobId = iJobId,
Expand All @@ -315,8 +317,9 @@ public override void SetJobState(string jobId, IState state)
CreatedAt = DateTime.UtcNow,
Data = JsonConvert.SerializeObject(state.SerializeData())
});
_.Database.Update(job);
_.Database.Commit();
}
});
}
Expand Down

0 comments on commit dd64c51

Please sign in to comment.