mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
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:
parent
0b21c69a46
commit
d19deea56c
3 changed files with 19 additions and 17 deletions
|
@ -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;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue