Toplam Gönderi:
24
Karma:
150
Katılım:
24.09.2010
yer:
Italy
I have developed a task, and it's working fine. I would like to implement also the possibility to run this task once, manually, from the configuration page (for testing purpose) in background (the task take some time to complete). Does anyone know if it's possible manually execute in background a nopcommerce task and where should I look ? thanks for any help Tommaso
Toplam Gönderi:
24
Karma:
150
Katılım:
24.09.2010
yer:
Italy
Uhm .... I don't think this is going to run in background / asynchronously ... this is just to call directly a class that implements ITask interface, and yes, works, but not in background.
Toplam Gönderi:
24
Karma:
150
Katılım:
24.09.2010
yer:
Italy
I need the EF of nopcommerce , that is not thread safe... and i have no idea about instantiate a new context....or if is possible... I'm trying to understand nopcommerce Task logic , but ThreadTask have internal constructors and it's anyway too advanced for my skill...
Toplam Gönderi:
24
Karma:
150
Katılım:
24.09.2010
yer:
Italy
ok.. looks like my dev environment was messed up... I suppose also the other solustion might work inside the controller you are using place: public ActionResult StuffToexecuteInBackground(DateTime StartSynchronizeFrom) { var plugin = RetrievePluginInstance(); ThreadPool.QueueUserWorkItem(plugin.Synchronize, objectWithParameters); return Configure(); } source: http://csharpfeeds.com/post/5415/Dont_use_the_ThreadPool_in_ASP.NET.aspx
Toplam Gönderi:
24
Karma:
150
Katılım:
24.09.2010
yer:
Italy
strange for some reason GetCurrentIpAddress() in webhelper class don't like being called in a new thread...
MVP
Sertifikalı Geliştirici
Toplam Gönderi:
1168
Karma:
12695
Katılım:
15.11.2011
yer:
United States
You're not in a web context during a task on a separate thread. There is no HttpRequest to pull that info from.