Piscal Queue working more resilient to error

This commit is contained in:
2016-04-18 10:44:36 -04:00
parent 6623aa48ea
commit badf048c49
20 changed files with 417 additions and 176 deletions
+11
View File
@@ -58,6 +58,17 @@ namespace LeafWeb.Core.DAL
select file;
}
public IQueryable<LeafInput> GetRunningLeafInputs()
{
return
from file in _db.LeafInputs
where
file.CurrentStatus == LeafInputStatusType.Running ||
file.CurrentStatus == LeafInputStatusType.Starting ||
file.CurrentStatus == LeafInputStatusType.Finishing
select file;
}
public void AddLeafInput(LeafInput leafInput)
{
leafInput.Added = DateTime.Now;
+3
View File
@@ -2,6 +2,7 @@
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.Entity.SqlServer;
using LeafWeb.Core.Entities;
using NLog;
namespace LeafWeb.Core.DAL
{
@@ -16,6 +17,8 @@ namespace LeafWeb.Core.DAL
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
LogManager.GetCurrentClassLogger().Debug("OnModelCreating");
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
base.OnModelCreating(modelBuilder);
}
+3
View File
@@ -3,6 +3,7 @@ using System.Linq;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Parsers;
using LeafWeb.Core.Utility;
using NLog;
namespace LeafWeb.Core.DAL
{
@@ -12,6 +13,8 @@ namespace LeafWeb.Core.DAL
protected override void Seed(LeafWebContext context)
{
LogManager.GetCurrentClassLogger().Debug("Seed");
// get fluxnet sites from file
var fileInfo = FileUtility.GetContentFile(ContentDirectory, "fluxnet_site_list_all_October2015_with_joins_corrected.csv", true);
var fluxnetSiteCsvParser = new FluxnetSiteCsvParser(fileInfo);