How to detect scheduled task request?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 7 ans
How can I detect if a request was made by a scheduled task, so I can ignore it (for example in global action filter)?


Regards,
Sven
Il y a 7 ans
Seems there is no way to tell a scheduled tasks call a url without adding a parameter or header to the request.
Il y a 7 ans
Hi Sven,

Do you mean HTTP request made by a schedule task? Or to detect whether current code is executed by a schedule task (without HTTP requests)? In the first case you have to add some headers. In the second case load the current customer ("CurrentCustomer" property of "IWorkContext") and see its "SystemName" property. It should be set to SystemCustomerNames.BackgroundTask ("BackgroundTask")
Il y a 7 ans
Hi Andrei,

I handled both as you suggested in the meantime ;-)

Thank you for clearing that up.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.