Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: cf6dcd8c94
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (24 sloc) 0.838 kB
using System;
using WebBackgrounder.EntityFramework.Entities;
namespace WebBackgrounder.EntityFramework {
public class JobUnitOfWork : IDisposable {
readonly EntityJobWorkerRepository _repository;
readonly JobWorker _currentJob;
bool _finished;
public JobUnitOfWork(EntityJobWorkerRepository repository, JobWorker job) {
_currentJob = job;
_repository = repository;
_repository.SetWorkerStarted(_currentJob);
}
public void Complete() {
_repository.UpdateIgnoredWorkers(_currentJob);
_repository.SetWorkerComplete(_currentJob);
_finished = true;
}
public void Dispose() {
if (!_finished) {
_repository.SetWorkerFailed(_currentJob);
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.