Developer forum

Forum » Development » Scheduled tasks

Scheduled tasks

Mads Sjørslev
Reply

Hi

Are every task in scheduled tasks running in a seperated thread so it won't affect the main thread?


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Mads,

I'm not sure exactly what you're asking.

Do you mean when a task runs on schedule or when you start it from the UI? Whenever a scheduled task runs, it takes resources from the server. That affects the entire solution, depending on what it's doing.

If you run a scheduled task from the UI then the task is executed on the main thread and you're waiting in the browser for the task to complete. If you let the scheduler handle it then they're run in a separate thread in a different request context. You can make a call to "<SolutionUrl>/Admin/Public/TaskExecute.aspx" to run all tasks that need to run according to the scheduling settings. This is actually how Dynamicweb handles it.

- Jeppe

 
Mads Sjørslev
Reply

Hi Jeppe

Thanks for your answer.

Sory for the wery short description. The reason why i'm asking is because we have a large integrationjob but I didn't know if it would stall the whole website if we created it as a scheduled add in.

The problem is that we have developed a connector service that commuticates with the erp, then we try to import priced we ned to make a lookup into dynamicweb to find the given variantId and unitId of a product, but the only solution we could find where to create a table script that handles the lookup, I just dont se it as a nice solution when we have around 2 m. prices. Do you have a beter solution?

Br. Mads

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

It sounds like you actually want to look into a batch integration job rather than a table script. That would enable you to use a simple data integration job that imports prices from an XML file, that the batch job downloads from your ERP system.

You can read about it here: https://doc.dynamicweb.com/documentation-9/integration/integration-framework-2/batch-integration

If you're using the Dynamicweb Connector Service or have developed yours on the foundation of it, then this should work out of the box. However, if you haven't then you can implement your own BatchIntegrationScheduledTaskAddin that can connect to your endpoint.

- Jeppe

 
Mads Sjørslev
Reply

I have just locked at it, and it seams that BatchIntegrationScheduledTaskAddin would be the right choice for our solution.

Thanks for your help.

Br. Mads

 

You must be logged in to post in the forum