Added the transaction back into the DB.

Do not run the episode cacher if it's been run in the last hour
This commit is contained in:
tidusjar 2016-08-08 13:38:26 +01:00
parent 0b21c69a46
commit d19deea56c
3 changed files with 19 additions and 17 deletions

View file

@ -290,26 +290,17 @@ namespace PlexRequests.Store.Repository
using (var db = Config.DbConnection())
{
db.Open();
//using (var tran = db.BeginTransaction())
//{
Log.Trace("Starting Transaction");
using (var tran = db.BeginTransaction())
{
var result = enumerable.Sum(e => db.Insert(e));
var done = result == enumerable.Length;
Log.Trace($"Total Result: {done}");
Log.Trace($"db result: {result}");
Log.Trace($"totalitems result: {enumerable.Length}");
if (done)
if (result != 0)
{
Log.Trace("Commiting");
//tran.Commit();
tran.Commit();
return true;
}
Log.Trace("Rolling back the tran");
//tran.Rollback();
tran.Rollback();
return false;
//}
}
}
}