How to detect scheduled task request?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
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
7 years ago
Seems there is no way to tell a scheduled tasks call a url without adding a parameter or header to the request.
7 years ago
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")
7 years ago
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.