Hi,
I have two programs:
1. a software that send data all the time to an api and the api save this data into the DB
2.a web that uses a worker that runs every 500 ms and save data into the DB
they both saves the same row, different fields
when one of them works:
the web load all the data is needed to the page like it should
when both of them works:
it takes a very long time till all the data is loaded to the page
i'm using stored procedure, and EF 6
here's the code that both worker and api are using to save data:
using (DBEntities db = new DBEntities())
{
var a = db.sp_SaveScale(item.GUID, item.MAC, item.CompanyID, item.Status, item.Weight, item.WeightDate, item.Active, item.Name, item.ScalesTypeID).ToList();
if (a.Count() > 0)
item.GUID = (long)a.ElementAt(0);
}
the stored procedure 'sp_SaveScale' saves all the record
what i need to do to fix the loading problem?
I need both worker and api, to work continuously
What I have tried:
I've tried delay both worker and api but still didn't help